Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Proposed fix for ZF2-569 validating float with trailing 0's (10.0, 10.10) #2388
The actual validation fails with trailing zeros inside decimal part like 10.0 or 10.10. This happens because NumberFormatter->parse('10.0') returns 10 and not 10.0 and the valueFiltered remains '10.0'.
This proposed fix removes all trailing 0 (and ending . if any) from valueFiltered before comparison.
The problem is described in http://framework.zend.com/issues/browse/ZF2-569