Bug->Doc #60083 [Csd->ReO]: NumberFormatter::formatCurrency wrong for CHF (Swiss Francs)

From: Date: Wed, 19 Oct 2011 14:25:51 +0000
Subject: Bug->Doc #60083 [Csd->ReO]: NumberFormatter::formatCurrency wrong for CHF (Swiss Francs)
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7337@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60083&edit=1 ID: 60083 Updated by: johannes@php.net Reported by: gman at xrbr dot com Summary: NumberFormatter::formatCurrency wrong for CHF (Swiss Francs) -Status: Closed +Status: Re-Opened -Type: Bug +Type: Documentation Problem Package: intl Operating System: SuSE Linux PHP Version: 5.3.8 Block user comment: N Private report: N New Comment: Re-Opening this as this should be made clear in the documentation. Can be quite unexpected. Previous Comments: ------------------------------------------------------------------------ [2011-10-18 10:29:59] gman at xrbr dot com They do not have "1 Rappen" coins! That is the reason. ------------------------------------------------------------------------ [2011-10-18 10:26:53] gman at xrbr dot com Description: ------------ I am not from Switzerland, but as far as I know they do have "Rappen", and 1 CHF is equal to 100 Rappen. So putting float 12.99 to NumberFormatter::formatCurrency should return the said 12,99 ("," is the correct decimal separator for de_DE), but what it does is to output 13,00 which is not correct! Test script: --------------- $varNumberFormatter1 = new NumberFormatter("de_DE", NumberFormatter::CURRENCY); var_dump($varNumberFormatter1->formatCurrency(12.99, "CHF")); $varNumberFormatter2 = new NumberFormatter("de_DE", NumberFormatter::CURRENCY); var_dump($varNumberFormatter2->formatCurrency(12.99, "EUR")); Expected result: ---------------- string(10) "12,99 CHF" string(10) "12,99 €" Actual result: -------------- string(10) "13,00 CHF" string(10) "12,99 €" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60083&edit=1

« previous php.doc.bugs (#7337) next »