adamwdraper/Numeral-js

Incorrect abbreviations for values rounded up

gscottolson opened this issue · 0 comments

There is a specific case in Numeral where values with abbreviation formats are not rounded up properly to the next abbreviation. There are two test cases I added (locally) that fail to format properly:

...
[999950,'0.0a','1m'],
[999999999,'0.0a','1b'],
...

The above cases will output incorrect abbreviation values:

999950 ⟶ 1000.0k
999999999 ⟶ 1000.0m

The logic around abbreviation bracketing is causing this issue. I tried creating a patch for this, but I couldn’t find a quick solution that didn’t introduce additional test failures.