Total Complexity | 4 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | class Conversion |
||
33 | { |
||
34 | /** |
||
35 | * Properties |
||
36 | */ |
||
37 | |||
38 | |||
39 | /** |
||
40 | * Methods |
||
41 | */ |
||
42 | /** |
||
43 | * Convert an incoming integer to a BTC string value |
||
44 | */ |
||
45 | static function BTC_int2str($val) |
||
|
|||
46 | { |
||
47 | $a = bcmul($val, "1.0", 1); |
||
48 | return bcdiv($a, "100000000", 8); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Convert a float value to BTC satoshi integer string |
||
53 | */ |
||
54 | static function BTC_float2int($val) |
||
55 | { |
||
56 | return bcmul($val, "100000000", 0); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * From comment on http://php.net/manual/en/ref.bc.php |
||
61 | */ |
||
62 | static function bcconv($fNumber) |
||
73 | } |
||
74 | } |
||
75 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.