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

Error round(0.0995, 3) #3

Closed
Magomogo opened this issue Mar 11, 2016 · 4 comments
Closed

Error round(0.0995, 3) #3

Magomogo opened this issue Mar 11, 2016 · 4 comments

Comments

@Magomogo
Copy link

expected: 0.100
got: 0.099

@sindresorhus
Copy link
Owner

This is what I get:

console.log(roundTo(0.0995, 3));
//=> 0.1

What OS & Node.js version are you on?

@Magomogo
Copy link
Author

Sorry, my fault, I did

var num = 0.597/6 // 0.0995
roundTo(num, 3) // 0.099

@Magomogo
Copy link
Author

It's not a problem of the component. But I'm stuck, how to make javascript to calculate this right?

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

2 participants