Skip to content
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

Meassurement charts rounding #695

Closed
eyJhb opened this issue Dec 7, 2024 · 5 comments
Closed

Meassurement charts rounding #695

eyJhb opened this issue Dec 7, 2024 · 5 comments

Comments

@eyJhb
Copy link

eyJhb commented Dec 7, 2024

Steps to Reproduce

  1. Add two weigh in e.g. 79.4 and 79.1
  2. Refresh chart
  3. Hopefully see rounding error?

Expected results:
I would expect it to not write 79.39999999999999, and instead just do 79.40.

Actual results:
Image

** Other **
I'm unsure if any of the improvements in #657 could cause it, or if it's just a preexisting thing.

@rolandgeider
Copy link
Member

yes, that is definitely a bit too much precision

@rolandgeider
Copy link
Member

mhhh, could not reproduce this, even with other "weird" numbers

@eyJhb
Copy link
Author

eyJhb commented Dec 13, 2024

I could reproduce it even on the latest master branch w/ Flutter desktop. I think the issue occurs, if the weight measurements are within the same whole number, but just different decimals. I reproduced it on wger.de, using the latest master branch.

I've made a user you can test on on wger.de
Username: issue-695@wger.de
Password: same as username

:)

@rolandgeider
Copy link
Member

weird that this only seemed to trigger with some numbers. But in any case this is fixed now 😎

Image

@Dieterbe
Copy link
Contributor

weird that this only seemed to trigger with some numbers

my guess is that the charting library uses doubles with one decimal over a long range, and many more decimals on a short range, so it just "happened to work" with the standard printing behavior, before.

thanks for the report and the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants