note 19068 deleted from function.number-format by nicos
| From: | nicos@php.net | Date: | Sun, 27 Jul 2003 19:50:29 +0000 |
| Subject: | note 19068 deleted from function.number-format by nicos | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-52801@lists.php.net to get a copy of this message | ||
Note Submitter: richardNOSPAM@sfolb.NO_SPAM.com
----
For many europeans like me, it is probably handy to have a EURO amount formatted to number_format(),
and then without the decimals. For most europeans this would mean dots in the thousands, and not
comma's, so to make your life easier, make the full monkey, then do the regular expression to
get the 2 decimals and the final comma off. Hope you find it useful.
$amount='300000';
$amount_new = number_format($amount, 2, ",", ".");
$amount_new =substr($amount_new, 0 , -3);
echo "€ $amount_new";
that would display EURO(sign) 300.000