Zend Framework

Zend_Filter_LocalizedToNormalized adds decimal separator though precision is zero

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.2, 1.10.0, 1.10.1
  • Fix Version/s: 1.10.2
  • Component/s: Zend_Filter
  • Labels:
    None

Description

A value filtered by Zend_Filter_LocalizedToNormalized includes a decimal separator at the end of the string even though the precision is specified as zero.

Test Case:

$n = '12345.67890';

$filter = new Zend_Filter_LocalizedToNormalized(array('locale' => 'en_US', 'precision' => 0));

Zend_Debug::dump($n, 'original');
Zend_Debug::dump($filter->filter($n), 'filtered');

Actual Output:

original string(11) "12345.67890"

filtered string(6) "12345."

Expected Output:

original string(11) "12345.67890"

filtered string(5) "12345"

Activity

Hide
Thomas Weidner added a comment -

Fixed with r21111

Show
Thomas Weidner added a comment - Fixed with r21111

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: