|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77892 Bad NumberFormatter::formatCurrency
Submitted: 2019-04-14 23:38 UTC Modified: 2019-04-15 01:24 UTC
From: patrice at flaho dot fr Assigned:
Status: Not a bug Package: intl (PECL)
PHP Version: 7.3.4 OS: debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: patrice at flaho dot fr
New email:
PHP Version: OS:


 [2019-04-14 23:38 UTC] patrice at flaho dot fr
$nf = new \NumberFormatter("fr", \NumberFormatter::CURRENCY);
echo '<br>',$nf->formatCurrency(12345.67, "EUR");

Result : 12?345,67 €, should return 12 345,67 €

It was working before upgrading php 7.3.3 -> 7.3.4

Test script:
$nf = new \NumberFormatter("fr", \NumberFormatter::CURRENCY);
echo '<br>',$nf->formatCurrency(12345.67, "EUR");

$nf = new \NumberFormatter("fr_FR", \NumberFormatter::CURRENCY);
echo '<br>',$nf->formatCurrency(12345.67, "EUR");

$nf = new \NumberFormatter("fr_CA", \NumberFormatter::CURRENCY);
echo '<br>',$nf->formatCurrency(12345.67, "EUR");

Expected result:
12 345,67 € for fr and fr_FR

Actual result:
12?345,67 € for fr and fr_FR
12 345,67 € for fr_CA


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-14 23:45 UTC]
-Status: Open +Status: Not a bug -Package: Unknown/Other Function +Package: intl
 [2019-04-14 23:45 UTC]
Looks like a change in libicu 63.
> Migration Issues
> 2. The French grouping separator changed from no-break space U+00A0 to narrow no-break space U+202F.
 [2019-04-14 23:48 UTC] patrice at flaho dot fr
Mys ICU config is :
Internationalization support	enabled
ICU version	64.1
ICU Data version	64.1
ICU TZData version	2018i
ICU Unicode version	12.0
 [2019-04-15 01:01 UTC]
Okay. But what version were you running before the upgrade?
 [2019-04-15 01:24 UTC] patrice at flaho dot fr, you are right, it has nothing to do with php but the new ICU.
Unfortunately most font do not have the U+202F character so it prints ? instead of the narrow space
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon May 10 22:01:24 2021 UTC