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

Use numeral () to convert percentages, occasionally losing precision #723

Open
Crushdada opened this issue Oct 28, 2021 · 0 comments
Open

Comments

@Crushdada
Copy link

For example, the following code:

Give you a stable value that loses precision.
console.log(numeral("8.14%").value());
// Return value: 0.08140000000000001
It seems that numeral does not have a very good solution to the problem of loss of JS computing accuracy.
Could you tell me how to deal with this bad situation?

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

1 participant