ZF-7922: Zend_Locale_Format::getFloat() throws Exception if input has only fractional digits
Description
Hi,
echo Zend_Locale_Format::getFloat('.99',array('precision' => 2, 'locale' => 'en_GB' ));
returns
bq. No localized value in .99 found, or the given number does not match the localized format
Comments
Posted by Sebastian Kors (skors) on 2009-09-22T08:58:28.000+0000
ups, wrong button hit...
My first thought was to edit the pattern in the locales XML, but had no success. So my solution isn't appended, in cause of only checking the first char if it matches numbers->symbols->decimal of the locale XML. Adding a pattern didn't work for me.
Thanks in advance,
Sebastian Kors
Posted by Thomas Weidner (thomas) on 2009-09-22T10:14:16.000+0000
This is not an issue.
According to CLDR a floating number MUST have a leading digit. This makes "0.99" an valid float, but ".99" not...
This is also true for patterns... the first char must be a digit.
Posted by Sebastian Kors (skors) on 2009-09-24T09:27:48.000+0000
Hello Thomas,
thanks for the reply and for clarification on this issue. I didn't recognized the CLDR point.
thanks.
Posted by Thomas Weidner (thomas) on 2009-09-25T02:36:00.000+0000
Allowed with r18406