Total Complexity | 2 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class Amount |
||
8 | { |
||
9 | const COIN = 100000000; |
||
10 | |||
11 | /** |
||
12 | * @param int $satoshis |
||
13 | * @return string |
||
14 | */ |
||
15 | 7 | public function toBtc(int $satoshis): string |
|
16 | { |
||
17 | 7 | return bcdiv((string)$satoshis, (string) self::COIN, 8); |
|
|
|||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @param string $btcAmount |
||
22 | * @return int |
||
23 | */ |
||
24 | 7 | public function toSatoshis(string $btcAmount): int |
|
27 | } |
||
28 | } |
||
29 |