js-number-abbreviate
js-number-abbreviate copied to clipboard
Rounding up/down should be an option, now it just do it automatically
tried doing abbreviate(13992, 1) and it returns "14k" where it should be "13.9k"
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'