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
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:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 10:01:28 2024 UTC