|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-09-13 21:25 UTC] sam at rmcreative dot ru
[2016-12-31 00:26 UTC] cmb@php.net
-Package: Feature/Change Request
+Package: intl
[2021-11-11 11:15 UTC] nikic@php.net
-Package: intl
+Package: I18N and L10N related
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 20:00:01 2025 UTC |
Description: ------------ Feature Request for the intl extension The MessageFormatter is capable of formatting a number in a currency format. This is only marginally useful because it always uses the currency symbol for the locale given to it. It probably wouldn't be uncommon to want to display a currency in your own currency format, but using a different currency symbol. Reproduce code: --------------- <?php $msgfmt = MessageFormatter::create('nl_NL', 'Price (USD): {0,number,currency}'); /* I'm assuming the format {0,number,currency} is not editable to something like {0,number,currency,USD} because it is defined in a underlying library. So I propose the following new method: */ $msgfmt->setCurrency('USD'); echo $msgfmt->format(array(15.95)); ?> Expected result: ---------------- Price (USD): $ 15,00 Actual result: -------------- (without the imagined setCurrency call) Price (USD): ? 15,00