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

When setting precision to 4/5 decimals some values are wrongly rounded and give a misleading number. #22

Open
knivek91 opened this issue Jun 6, 2024 · 2 comments

Comments

@knivek91
Copy link

knivek91 commented Jun 6, 2024

Hi!

I was using the library and I noticed that when we use it as a Percentage with 4/5 decimals the library rounds the provided number; this only happens when the number is 10 | 20 | 40 | 80 if you enter any of those numbers and you blur the input it will add the decimals with a 1 at the end.

I took a look at the code and looks like the last commit introduced the bug.

I made a video where we can see the behavior I'm trying to describe

intl_number_input_issue.mp4
@ragulka
Copy link
Contributor

ragulka commented Aug 13, 2024

I can confirm this issue - just ran into it. Downgrading to 1.4.0 as a workaround does solve the issue.

I've opened A PR with failing tests and some of my thoughts or where the bug may occur.

@dm4t2
Copy link
Owner

dm4t2 commented Aug 14, 2024

Thanks for reporting! I'll take a look at it 👀

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