Bug #77483 [Opn->Fbk]: NumberFormatter::formatCurrency rounding issues with CHF (Swiss Francs)
| From: | cmb@php.net | Date: | Fri, 18 Jan 2019 11:00:12 +0000 |
| Subject: | Bug #77483 [Opn->Fbk]: NumberFormatter::formatCurrency rounding issues with CHF (Swiss Francs) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219049@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77483&edit=1
ID: 77483
Updated by: cmb@php.net
Reported by: 1000nettles at gmail dot com
Summary: NumberFormatter::formatCurrency rounding issues with
CHF (Swiss Francs)
-Status: Open
+Status: Feedback
Type: Bug
Package: Unknown/Other Function
Operating System: Amazon Linux / CentOS
PHP Version: 7.1.26
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
It seems to me this never was a PHP issue, but rather an ICU
issue. Which INTL_ICU_VERSION do you use?
Previous Comments:
------------------------------------------------------------------------
[2019-01-17 22:46:41] 1000nettles at gmail dot com
Description:
------------
Hi there,
It looks as if a bug that was fixed years ago (https://bugs.php.net/bug.php?id=60083) has reappeared
in PHP 7.1.x. While using NumberFormatter::formatCurrency, if you specify CHF (Swiss Francs) as a
currency, it will round to the nearest 0.05.
Test script:
---------------
$formatter = new \NumberFormatter('en_US', \NumberFormatter::CURRENCY);
echo $formatter->formatCurrency(12.99, 'CHF');
Expected result:
----------------
CHF12.99
Actual result:
--------------
CHF13.00
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77483&edit=1