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

Issue Type: Bug Created: 2010-02-12T12:48:58.000+0000 Last Updated: 2010-02-20T12:42:32.000+0000 Status: Resolved Fix version(s): - 1.10.2 (24/Feb/10)

Reporter: Andrew Ballard (aballard) Assignee: Thomas Weidner (thomas) Tags: - Zend_Filter

Related issues: Attachments:


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:

<pre class="highlight">
$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:

<pre class="literal">
original string(11) "12345.67890"

filtered string(6) "12345."

Expected Output:

<pre class="literal">
original string(11) "12345.67890"

filtered string(5) "12345"


Posted by Thomas Weidner (thomas) on 2010-02-20T12:42:32.000+0000

Fixed with r21111

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.