Skip to content

Commit

Permalink
Added information on helpers.
Browse files Browse the repository at this point in the history
  • Loading branch information
denpamusic committed Sep 14, 2018
1 parent ff1b8a6 commit ed7716d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,28 @@ You can use `wallet($name)` function to do a [Multi-Wallet RPC call](https://en.
*/
$balance = $bitcoind->wallet('wallet2.dat')->getbalance();

$balance->get(); // 0.10000000
echo $balance->get(); // 0.10000000
```


## Helpers
Package provides following helpers to assist with value handling.
### to_bitcoin
Converts value in satoshi to bitcoin.
```php
echo Denpa\Bitcoin\to_bitcoin(1000); // 0.00001000
```
### to_satoshi
Converts value in bitcoin to satoshi.
```php
echo Denpa\Bitcoin\to_satoshi(0.00001); // 1000
```
### to_fixed
Trims float value to precision without rounding.
```php
echo Denpa\Bitcoin\to_fixed(0.1236, 3); // 0.123
```

## License

This product is distributed under MIT license.
Expand Down

0 comments on commit ed7716d

Please sign in to comment.