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
 [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: Thu Apr 25 01:01:30 2024 UTC