PHP code example of iillexial / cryptocurrencies-money
1. Go to this page and download the library: Download iillexial/cryptocurrencies-money library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
iillexial / cryptocurrencies-money example snippets
use Money\Cryptocurrencies\Currencies\Cryptocurrencies;
use Money\Currencies\AggregateCurrencies;
use Money\Currencies\ISOCurrencies;
use Money\Cryptocurrencies\Formatter\CryptocurrencyMoneyFormatter;
$currencies = new Cryptocurrencies();
// or
$currencies = new AggregatedCurrencies([
new Cryptocurrencies(), new ISOCurrencies()
]);
$cryptocurrencyFormatter = new CryptocurrencyMoneyFormatter(2);
echo $cryptocurrencyFormatter->format(new Money(1 * 10**8, new Currency('BTC'))); // 1 BTC