Numeral.js – A JavaScript library for formatting and manipulating numbers
numeraljs.com
numeraljs.com
Shameless plug: as part of the in-browser XLS parsing, we built a library for formatting numbers: https://github.com/SheetJS/ssf
As you may now, there is a difference between kilobytes (KB) and kibibytes (KiB), megabytes (MB) and mibibytes (MiB) et cetera. 1 KiB = 1024 bytes = 1.024 KB.
Please check out https://en.wikipedia.org/wiki/Binary_prefix and fix your library :)
Nowadays I've only ever seen US-style commas and it's hard to even find a reference to the four-digit commas online.
Still, nice effort! I like it
I've been using this with great results so far. It works well with a loader (e.g. yepnope) as Chrome and Firefox support it natively, as does IE11.
But no, I don't want to develop only for Chrome, and these days, you see a lot of that happening on "cool tech", even when there is the equivalent in, at least, Firefox.
That said, numeral.js doesn't look like just subset, it's got a nice interface to work with, and you don't have to worry about cross-browser inconsistency. You just have to believe this library does everything correctly for each language/locale.
It aims to mimic how number formatting is done on the server.
Used on many projects, works well.
Because you know, why implement UTS #35? It exists and covers dozens of cultural contexts and that's no fun.
No, numbers aren't (shouldn't be) treated as objects.