Numeral.js
A javascript library for formatting and manipulating numbers
... of 0 or null. Adding your own custom formats is as easy as adding a locale. Numeral.js, while less complex, was inspired by and heavily borrowed from Moment.js Formats now exist in their own files and act more or less as plugins. Check out the bytes format for an example of how to create one. When naming locale files use the ISO 639-1 language codes supplemented by ISO 3166-1 country codes when necessary.