-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: validateInteger #165
Comments
We don't, in the times of the Google Translator. What is wrong? |
Ok here is example: I want validate VAT number - its numeric value, so i validate like numeric and in the next step i validate if TIN number exist. I have TIN: 04011236 But on next row u transfer my TIN number to int: (04011236*1) = 4011236 I validate form like: I validate VAT like numeric - so why you convert my numeric number to int ? |
I understand you perfectly :) |
Because of compatibility it can not be fixed in 2.4, so use |
Ok, thanx 👍 |
Taky jsem měl s tímto problém, nestalo by za to přidat to do dokumentace? |
To by bylo fajn, mohl bys prosím poslat PR do https://github.com/nette/docs? |
Description
Snad omluvíte češtinu :)
Problém vidím v parsování hodnoty do INT:
$value = "0123456";
if (Validators::isNumericInt($value = $control->getValue())) {
// $value = "0123456";
if (!is_float($tmp = $value * 1)) { // bigint leave as string
// $tmp = 123456
$control->setValue($tmp);
}
}
Steps To Reproduce
$value = 123456, $result = INT(123456) // OK
$value = 0123456, $result = INT(123456) // ERROR
Chtělo by to ještě nějak pokrýt numeric hodnoty, nejen float :)
The text was updated successfully, but these errors were encountered: