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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: patrice at flaho dot fr
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sun Dec 22 01:01:30 2024 UTC