Numeral-js
Numeral-js copied to clipboard
Fix formatting for small numbers.
Fixes #596. Formatting numbers smaller than approximately 1e-6 resulted in NaN (instead of a formatted string). This was due to coercing the numeric value to a string and adding an exponential notation to that; however, small numbers coerce to exponential representation anyway, so it was getting that notation twice. In other words, 1e-7 would result in the string 1e-7e+0 (for example), which was not parsing correctly.
Note that this is redundant with PR #635: when I was formatting this PR, I thought I'd look at some other PRs to see what the convention for PRs was, and lo and behold, the first one I found was a fix for this exact issue. My fix is a more compact, but may exhibit undesirable behavior when formatting very small numbers (when the format can actually go down that low).
A bigger concern is what's the status of maintenance of this package?
I wonder what's the status of this whole project too, since I collected 4 PRs addressing this issue. Other PRs correct minor issues which could be easily merged as well.
Yeah, @MrCsabaToth, I think this project is dead in the water. Seems like https://github.com/BenjaminVanRyseghem/numbro is the new numeral.js :/
I wonder if @adamwdraper would hand over the project to someone who could crunch over all the PRs and merge many at least. Thanks for the tip I'll check that other project out.
👀