I have a simple question for which I did not find an answer, and this
How can I use the built-in Zend Validator to check if the float / dobule is greater than or equal to min?
I was already looking for an answer that matches my query, and I found this question by the GreaterOrEqual validator in the Zend Framework , but mine is a little different. In addition, I know that I can create my own validator or copy one of those that are on the Internet, like this Greater Than or Equal Validator , but I would like to know how I can perform this check with the built-in validators.
This is an example that will help you better understand.
If I had an integer, I could achieve this goal as follows:
$Validators = array(new Zend_Validate_Int(), new Zend_Validate_GreaterThan($min - 1));
Instead, if I had a float, I cannot do this trick, and as many programmers know, trying to do dirty things with a float can create a lot of problems due to the rounding problem ( What every computer scientist needs to know about arithmetic with floating point ).
Thank you all
source share