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
Form Validation of IntegerType is rounding bigint with no warning #30582
Comments
Which exact version of the Form component did you use when this happened? Which concrete values are not handled correctly? Is your PHP using 32 or 64 bits? |
@xabbuh the version in my
an example of the value that wasn't handled is: I'm running this on Docker with the next php tag |
Can you please try this with 4.2.4? This may be fixed by #30063 which was part of the 4.2.4 release. |
@xabbuh Indeed the problem is fixed in version 4.2.4. Thanks |
Cool, thank you for the confirmation. 👍 I am going to close here then. |
This still seems to happen for integers with more than 15 digits, I think because of the use of the php floor() and ceil() functions in the rounding. Perhaps an extra option of intval() for the rounding_mode option would give folks the option to avoid using floor() or ceil() and so avoid the jump to floating point and back? |
Symfony version(s) affected: 4.x.x
Description
Whenever we try to validate a bigint with IntegerType the number will be rounded with no warning
How to reproduce
Additional context
I'm using this version of symfony form
"symfony/form": "^4.2"
The text was updated successfully, but these errors were encountered: