php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75371 Wrong decimal separator and currency position
Submitted: 2017-10-12 22:46 UTC Modified: 2021-02-12 13:25 UTC
From: erosdelalamo at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: intl (PECL)
PHP Version: 5.6.31 OS: all
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: erosdelalamo at gmail dot com
New email:
PHP Version: OS:

 

 [2017-10-12 22:46 UTC] erosdelalamo at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/numberformatter.formatcurrency
---

Decimal and thousand separator and currency position are based on language instead Country. 

I.e.: A website in english targeting france en_FR displays currency with british format

Test script:
---------------
// Locale: en_GB

$fmt = new NumberFormatter( 'en_GB', NumberFormatter::CURRENCY );
echo $fmt->formatCurrency(1234567.891234567890000, "EUR")."\n";

// output €1,234,567.89


// Locale: en_FR
$fmt = new NumberFormatter( 'en_FR', NumberFormatter::CURRENCY );
echo $fmt->formatCurrency(1234567.891234567890000, "EUR")."\n";

// output €1,234,567.89, should be 1.234.567,89 €


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-13 00:20 UTC] kalle@php.net
-Type: Bug +Type: Documentation Problem
 [2021-02-12 13:25 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2021-02-12 13:25 UTC] cmb@php.net
en_FR makes no sense, since English isn't an official language in
France, so Intl falls back to en, what should be expected.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 06:01:32 2025 UTC