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 up/down should be an option, now it just do it automatically #13

Open
Sebastp opened this issue Apr 30, 2024 · 1 comment
Open

Comments

@Sebastp
Copy link

Sebastp commented Apr 30, 2024

tried doing abbreviate(13992, 1) and it returns "14k" where it should be "13.9k"

@domharrington
Copy link
Owner

I think this is expected functionality! See some of the tests. Anything larger than 13950 gets rounded up:

> abbreviate(13949, 1)
'13.9k'
> abbreviate(13950, 1)
'14k'

Would accept a PR to disable rounding, if you're interested! Alternatively, if you want 2 decimal places you could do this:

> abbreviate(13992, 2)
'13.99k'

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