Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6.2
-
Fix Version/s: 1.8.0
-
Component/s: Zend_Currency
-
Labels:None
Description
Precision error when given a number to method toCurrency()
$zendLocale = new Zend_Locale($config->locale);
Zend_Locale::setDefault('pt_PT');
// define default Zend_Locale_Format
Zend_Locale_Format::setOptions(array(
'locale' => $zendLocale,
'precision' => 2
));
$zendCurrency = new Zend_Currency($zendLocale);
$zendCurrency->toCurrency($price);
if the price is 14.2278 for example it returns 14,22 € (localized number) when actually should return 14,23 €
I managed to correct this using toFloat() on line 173 of Zend/Currency.php file, instead of toNumber().
Is this the right stuff to do?
Issue Links
| This issue is dependecy of: | ||||
| ZF-3473 | Zend_Locale_Format::toNumber(9.72, array('locale' => 'en')) returns 9.7 instead of 9.72 |
|
|
|
Dependent of
ZF-3473ZF-3473