Zend Framework

Zend_Locale_Format::getFloat() throws Exception if input has only fractional digits

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.10.0
  • Component/s: Zend_Locale
  • Labels:
    None

Description

Hi,

echo Zend_Locale_Format::getFloat('.99',array('precision' => 2, 'locale' => 'en_GB' ));

returns

No localized value in .99 found, or the given number does not match the localized format

Activity

Hide
Sebastian Kors added a comment -

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

Show
Sebastian Kors added a comment - 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
Hide
Thomas Weidner added a comment -

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.

Show
Thomas Weidner added a comment - 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.
Hide
Sebastian Kors added a comment -

Hello Thomas,

thanks for the reply and for clarification on this issue.
I didn't recognized the CLDR point.

thanks.

Show
Sebastian Kors added a comment - Hello Thomas, thanks for the reply and for clarification on this issue. I didn't recognized the CLDR point. thanks.
Hide
Thomas Weidner added a comment -

Allowed with r18406

Show
Thomas Weidner added a comment - Allowed with r18406

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: