Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.0RC1
-
Fix Version/s: 1.7.3
-
Component/s: Zend_Locale
-
Labels:None
Description
bcmath extension uses strings as an input.
Some floats are automatically written using scientific notation while they are converted to strings (like '1.234E-6').
bcmath extension skips exponent part of the number (e.g. '1.234E-6' => '1.234'). That produces wrong results of mathimatical operations with some numbers.
Hopefully, bcmath functions are not used directly within Zend Framework (except some big integers arithmetic within Zend_OpenId which is not affected by this problem). So we can proxy bcmath calls and perform correct numbers transformation.
That also may help to solve problems with some locales having ',' as decimal separator.
Issue Links
| This issue is related to: | ||||
| ZF-5374 | bcmath doesn't handle numbers in exponential notation |
|
|
|
We can solve this by adding this code to Zend_Locale_Math::normalize:
Test :
Note : bcmath is required.