|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-05-26 12:00 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Package: Date/time related
+Package: intl
-Assigned To:
+Assigned To: cmb
[2019-05-26 12:00 UTC] cmb@php.net
[2019-05-26 17:05 UTC] shariefjamiel at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 00:00:01 2025 UTC |
Description: ------------ I am trying to use the Number formatter to get information but the get text attribute is returning strange results. Test script: --------------- setlocale(LC_ALL,'en_GB'); Locale::setDefault('en_GB'); $formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY); // This should be currency symbol but result is null $result = $formatter->getTextAttribute(NumberFormatter::CURRENCY_SYMBOL); // This should be decimal sperator, but its the currency symbol $result = $formatter->getTextAttribute(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL) Expected result: ---------------- // This should be currency symbol but result is null echo $formatter->getTextAttribute(NumberFormatter::CURRENCY_SYMBOL); // £ // This should be decimal sperator, but its the currency symbol echo $formatter->getTextAttribute(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL); // . Actual result: -------------- // This should be currency symbol but result is null echo $formatter->getTextAttribute(NumberFormatter::CURRENCY_SYMBOL); // NULL // This should be decimal sperator, but its the currency symbol echo $formatter->getTextAttribute(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL); // £