|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64703 NumberFormatter getPattern() returns incorrect currency pattern
Submitted: 2013-04-24 10:24 UTC Modified: 2013-04-24 15:29 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: andy at websitevision dot co dot uk Assigned:
Status: Not a bug Package: intl (PECL)
PHP Version: Irrelevant OS: Windows 7
Private report: No CVE-ID: None
 [2013-04-24 10:24 UTC] andy at websitevision dot co dot uk
Using PHP 5.4.3 with php_intl extension loaded...

NumberFormatter->getPattern returns an incorrect pattern for currencies where the locale is somewhere that uses commas as the decimal. NumberFormatter->formatCurrency correctly places the dot and the comma, but the pattern returned by getPattern has these the wrong way round (see Test script).

Test script:
$fmt = new NumberFormatter('es', NumberFormatter::CURRENCY);
echo $fmt->getPattern();
echo "<br>";
echo $fmt->formatCurrency(9999.99, 'EUR');

// displays as:
// ¤ #,##0.00
// € 9.999,99

Expected result:
€ 9.999,99

Actual result:
€ 9.999,99


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-24 15:29 UTC]
-Status: Open +Status: Not a bug
 [2013-04-24 15:29 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The format looks correct. Please consult the ICU API docs
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 09:01:29 2024 UTC