ZF-2700: Zend_Validate_Float might error with localeconv
Description
in Zend_Validate_Float de lines (64-65):
$valueFiltered = str_replace($locale['decimal_point'], '.', $valueString); $valueFiltered = str_replace($locale['thousands_sep'], '', $valueFiltered);
should be replaced by :
$valueFiltered = str_replace( array( $locale['decimal_point'], $locale['thousands_sep']), array( '.', '' ), $valueString );
Otherwise for example the dutch locale : 1.000.000,00 would transform to 100000000 instead of 1000000.00
Comments
Posted by Thomas Weidner (thomas) on 2008-03-09T15:07:45.000+0000
Not quite right... the solution is simpler.
I don't know why this code was duplicated because it exists already in Zend_Locale. But to get the right normalised value you have first to delete the thousand seperators and at last change the decimal point.
Or you could simply use Zend_Locale_Math::normalize();
I changed the two lines and it should now work with the existing solution and without any new feature.
Posted by Thomas Weidner (thomas) on 2008-03-09T15:08:20.000+0000
Fixed with SVN-8714