-
-
Notifications
You must be signed in to change notification settings - Fork 588
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
Floats incorrectly serialized to xml #1284
Comments
I am experiencing the same issue after upgrading to v3. |
an option would be to introduce a "precision" parameter to float numbers.... something linke |
Hello everyone, I've experienced the same problem earlier today and could not find any information on how to format Also, I'm unable to reproduce the results described by @peterlozano on 3v4l cutting the middleman and directly giving the float to Best regards |
it would be great if someone could send a PR with such improvement |
And here it is ;) |
done in #1359 |
After an upgrade from 1.14.1 to 3.11.0, float values were not serialized correctly.
For example:
348.47 was serialized to xml as 348.46999999999997
I'm using PHP 7.2.23
It seems var_export may format floats this way for some reason:
serializer/src/XmlSerializationVisitor.php
Line 182 in f91971c
See:
The text was updated successfully, but these errors were encountered: