-
Notifications
You must be signed in to change notification settings - Fork 265
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
Invalid JSON on GET request due to rounding error of decimal numbers #4346
Comments
Thanks for the report! Reproduced with newest Orion version (3.8.0) in language-agnostic way. Creating entity this way:
Getting the entity, wrong JSON:
Entity at DB is fine, so it is a problem in the rendering logic:
|
Thanks for providing the code to reproduce this! |
Problem is here
value is ok, but it is wronly rendered in the So it seems double2string() function has flaws. |
PR #4354 |
This issue should be fixed now in master branch. @FWuellhorst could you tests using |
@fgalan Yes, it does work for me! Thanks for the quick fix! |
For questions about Orion, please use the proper channel, which is https://stackoverflow.com (using the "fiware-orion" label). Github issues are for other kind of items (bugs, feature requests, etc.). Given the positive feedback in the previous comment (thanks!), I'm going to close this issue. |
Bug description
How to reproduce it
7.999999999536117
I know this is not a clear script to reproduce, but maybe it is already sufficient to reproduce. If the error does not occur on your side, I can invest the time and give a detailed script to reproduce.
Expected behavior
Either return
7.999999999536117
or8.0
as the value for the attribute.The text was updated successfully, but these errors were encountered: