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

Fix/percentage precision error #1108

Merged
merged 1 commit into from
Feb 6, 2023
Merged

Conversation

bofeiw
Copy link
Contributor

@bofeiw bofeiw commented Feb 3, 2023

Fixes the javascript floating point error in percentage field, as spotted in Discord support channel.

Screenshot 2023-02-04 at 04 20 47

The issue is that the native multiplication in javascript produces floating point error. e.g. 0.07*100 === 7.000000000000001.

Easy fix: moving the decimal point to left/right 2 places as a string while converting number and percentage, rather than using the native multiplication/divide operator.

@vercel
Copy link

vercel bot commented Feb 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
rowy-os ✅ Ready (Inspect) Visit Preview Feb 3, 2023 at 8:23PM (UTC)
1 Ignored Deployment
Name Status Preview Updated
rowy-typedoc ⬜️ Ignored (Inspect) Feb 3, 2023 at 8:23PM (UTC)

@bofeiw bofeiw changed the base branch from main to develop February 3, 2023 20:23
@shamsmosowi shamsmosowi merged commit 9758cc2 into develop Feb 6, 2023
@bofeiw bofeiw deleted the fix/percentage-precision-error branch February 6, 2023 10:01
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

Successfully merging this pull request may close these issues.

2 participants