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

Rounding bugs #116

Closed
pdcmoreira opened this issue May 21, 2018 · 1 comment
Closed

Rounding bugs #116

pdcmoreira opened this issue May 21, 2018 · 1 comment

Comments

@pdcmoreira
Copy link

Test: currency('1312.444445', {precision: 2})
Expected: 1312.45
Got: 1312.44

Test: currency(1312.45, {precision: 0})
Expected: 1313
Got: 1313

Test: currency('1312.45', {precision: 0})
Expected: 1313
Got: 1312

Only the second test yields a correct result! Then if I just pass the value as string instead of a number, the result is wrong!

@scurker
Copy link
Owner

scurker commented May 21, 2018

Looks like I handled numeric rounding in #102, but completely missed string rounding. Good catch! I'll have a patch release soon.

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