Issues

ZF-9160: Zend_Filter_LocalizedToNormalized adds decimal separator though precision is zero

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"

Comments

Fixed with r21111