Baron Schwartz's Website
Archives Talks

JavaScript Number-Formatting Library Updated

Published Jun 19, 2007 by Baron Schwartz in Web at https://www.xaprb.com/blog/2007/06/19/javascript-number-formatting-library-updated/

I’ve released a new version of my powerful, flexible, efficient JavaScript number-formatting library, which is probably the best available. This release adds a fix for zero-padding negative numbers.

If you find bugs, please send me test cases I can use to reproduce and add to the unit test suite. One test per line, like “input”, “format”, “expected” is best. For example, this is a great test case:

-1, "#,#.00", "-1.00"

I can plug that directly into the unit test suite, run it, and if it gives back “-01.00” it will fail the test. This makes it much easier and more convenient for me to fix bugs.

Baron Schwartz

I’m the founder and CTO of VividCortex, author of several books, and creator of various open-source software. I write about topics such as technology, entrepreneurship, and fitness. More about me.

Story logo

© 2019 Baron Schwartz