1. Go to this page and download the library: Download gerardojbaez/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/ */
gerardojbaez / money example snippets
$money = new Gerardojbaez\Money\Money(12.99, 'USD')
$money->format(); // RESULT: $12.99
// You can also use the
erardojbaez\Money\Money;
$money = new Money(100);
$money->format();
$money = new Gerardojbaez\Money\Money(1000000, 'INR');
echo $money->format(); // RESULT: र10,00,000
echo $money; // The same as using $money->format()
echo $money->amount(); // RESULT: 10,00,000
$currency = new Gerardojbaez\Money\Currency('USD');
$currency->setPrecision(3);
$currency->setThousandSeparator('.');
$currency->setDecimalSeparator(',');
$currency->setSymbolPlacement('after');
$money = new Gerardojbaez\Money\Money(1200.9, $currency);
echo $money; // RESULT: 1.200,900$ (example)
// OR
echo moneyFormat(1200.9, $currency);