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

Negative rounding up is not consistent #758

Open
manoharanamphora opened this issue Apr 26, 2024 · 1 comment
Open

Negative rounding up is not consistent #758

manoharanamphora opened this issue Apr 26, 2024 · 1 comment

Comments

@manoharanamphora
Copy link

When using numbro(12.455).format({mantissa:2});, it returns "12.46". However, for negative numbers like numbro(-12.455).format({mantissa:2});, it returns "-12.45" instead of "-12.46", which should be the expected rounded value.

@BenjaminVanRyseghem
Copy link
Owner

Here is how JS works:

Math.round(1245.5) // 1246
Math.round(-1245.5) // -1245

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