Issues

ZF-5879: 0.000000234 << not a float!?

Description

<?php
require_once 'Zend/Validate.php';
$float = 0.000000234;

var_dump(Zend_Validate::is($float,'Float'));

// false
<?php
require_once 'Zend/Validate.php';
$float = 1.0000000234;

var_dump(Zend_Validate::is($float,'Float'));

// true
<?php
require_once 'Zend/Validate.php';
$float = 0.000050004;

var_dump(Zend_Validate::is($float,'Float'));

//false
<?php
require_once 'Zend/Validate.php';
$float = 0.005000004;

var_dump(Zend_Validate::is($float,'Float'));

//true

In other words: 100% valid floats are not considered a float.

Comments

The problem is caused by float numbers recognition within Zend_Locale_Format. E notation is not processed.

0.000050004 and 0.000000234 are transformed into '5.0004E-5' and '2.34E-7' then they passed into Zend_Locale_Format::isFloat()

Fixed with r14170