PHP code example of mrprompt / money

1. Go to this page and download the library: Download mrprompt/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/ */

    

mrprompt / money example snippets


use MrPrompt\Money\Currency;

$money = new Currency('BRL');
$money->code(); // return the code (the same passed at constructor)
$money->number(); // return the code as number, like 960.
$money->name(); // return the currency name, like Real
$money->countries(); // return the countries that use the currency
$money->decimals(); // return the decimals used by the currency
$money->symbol(); // return the symbol of the currency
$money->format(1.00); // format the currency