ZF-9698: CLONE - Precision and number_format seems to be broken
Description
I've noticed when bcmath extension is enabled the problem with broken precision and number_format reoccurs.
$number = Zend_Locale_Format::toNumber(13547.3678,
array('precision' => 2,
'locale' => $locale));
returns 13547.36 with bcmath enabled. Zend Server 5.0, ZF 1.10.2, PHP 5.2.12, Windows 7. Correct output should be 13547.37.
Comments
Posted by Thomas Weidner (thomas) on 2010-04-20T13:37:53.000+0000
Closing as not reproduceable
Using the given code with locale 'de' and var_dump of the returned output I get
Using 'fr' I get:
Both results are correct.
Posted by Michal Lasak (mlasak) on 2010-04-21T08:41:55.000+0000
Thomas, have you turned bcmath extension on? This simple script is not working for me with bcmath enabled.
Outputs:
Posted by Michal Lasak (mlasak) on 2010-04-21T08:42:51.000+0000
Please turn on bcmath extension to reproduce problem!
Posted by Thomas Weidner (thomas) on 2010-04-22T11:50:08.000+0000
Using your code I get
Note that I am running my tests on Windows where bcmath is enabled per default.
Posted by Michal Lasak (mlasak) on 2010-04-22T12:22:49.000+0000
I've upgraded to ZF 1.10.3 and problem disappears. (but was still present on 1.10.2 :)) Thanks for your willingness anyway.