php.net |  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
25 + 38 = ?
Subscribe to this entry?

 
 [2019-04-14 23:38 UTC] patrice at flaho dot fr
Description:
------------
$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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-14 23:45 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: Unknown/Other Function +Package: intl
 [2019-04-14 23:45 UTC] requinix@php.net
Looks like a change in libicu 63.

http://site.icu-project.org/download/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 :
intl
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] requinix@php.net
Okay. But what version were you running before the upgrade?
 [2019-04-15 01:24 UTC] patrice at flaho dot fr
@requinix@php.net, 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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC