note 116420 added to numberformatter.formatcurrency
| From: | JoelD | Date: | Tue, 30 Dec 2014 23:49:15 +0000 |
| Subject: | note 116420 added to numberformatter.formatcurrency | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201283@lists.php.net to get a copy of this message | ||
To remove the currency symbol from being outputted, but still have the rest of the number formatted
like currency, you can use:
$fmt = new NumberFormatter('de_DE', NumberFormatter::CURRENCY);
$fmt->setPattern(str_replace(array("\xc2\xa0\xc2\xa4", "\xc2\xa4\xc2\xa0",
"\xc2\xa4"), '', $fmt->getPattern()));
echo $fmt->formatCurrency(28472.48, 'GBP')
----
Server IP: 72.52.91.14
Probable Submitter: 184.69.13.2
----
Manual Page -- http://php.net/manual/en/numberformatter.formatcurrency.php
Edit -- https://master.php.net/note/edit/116420
Del: integrated -- https://master.php.net/note/delete/116420/integrated
Del: useless -- https://master.php.net/note/delete/116420/useless
Del: bad code -- https://master.php.net/note/delete/116420/bad+code
Del: spam -- https://master.php.net/note/delete/116420/spam
Del: non-english -- https://master.php.net/note/delete/116420/non-english
Del: in docs -- https://master.php.net/note/delete/116420/in+docs
Del: other reasons-- https://master.php.net/note/delete/116420
Reject -- https://master.php.net/note/reject/116420
Search -- https://master.php.net/manage/user-notes.php