1. Go to this page and download the library: Download moltin/currency 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/ */
moltin / currency example snippets
use Moltin\Currency\Currency as Currency;
use Moltin\Currency\Format\Runtime as RuntimeFormat;
use Moltin\Currency\Exchange\OpenExchangeRates as OpenExchange;
$currency = new Currency(new OpenExchange($app_id), new RuntimeFormat);
$currency->convert(9.33)->from('GBP');
// Returns 9.33
$value = $currency->value();
// Returns £9.33
$value = $currency->format();
// Sets value to 10.00
$currency->zeros();
// Sets value to 9.99
$currency->nines();
// Sets value to 9.50
$currency->fifty();
// Returns £9.50
$value = $currency->fifty()->format();