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

Wrong rounding on toFixed() for negative numbers #215

Open
pgeimer opened this issue Jul 6, 2020 · 0 comments
Open

Wrong rounding on toFixed() for negative numbers #215

pgeimer opened this issue Jul 6, 2020 · 0 comments

Comments

@pgeimer
Copy link

pgeimer commented Jul 6, 2020

toFixed() returns wrong rounded values on negative numbers:

accounting.toFixed(-2.5, 0) // Returns -2 (expected -3)
accounting.toFixed(2.5, 0) // Returns 3

See: https://jsbin.com/himapogoyo/edit?html,js,console

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