Skip to content
Snippets Groups Projects
Commit 58c67cac authored by Giovannoni Laurent's avatar Giovannoni Laurent
Browse files

evo: new format of amount

parent 8a32072e
No related branches found
No related tags found
No related merge requests found
...@@ -1705,4 +1705,26 @@ class functions ...@@ -1705,4 +1705,26 @@ class functions
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
); );
} }
/**
* Return the amount corresponding to the currency
* @param $currency string currency of the amount
* @param $amount float the amount
*/
function formatAmount($currency, $amount)
{
$formattedAmount = '';
if ($currency == 'EUR') {
$formattedAmount = '€ ' . number_format($amount , 2 , ',' , '.' );
} elseif ($currency == 'DOL') {
$formattedAmount = '$ ' . number_format($amount , 2 , '.' , ',' );
} elseif ($currency == 'YEN') {
$formattedAmount = '¥ ' . number_format($amount , 2 , '.' , ',' );
} elseif ($currency == 'POU') {
$formattedAmount = '£ ' . number_format($amount , 2 , '.' , ',' );
} else {
$formattedAmount = ' ' . number_format($amount , 2 , '' , '.' );
}
return $formattedAmount;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment