Tag Archive for 'numbers'

JavaScript number-formatting library updated

Download number-functions

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.

Sponsoring bug fixes wouldn’t hurt either ;-)

Technorati Tags:, , , , , , , ,

You might also like:

  1. JavaScript Number Formatting Library v1.3 released
  2. JavaScript formatting library update
  3. How to format numbers in JavaScript flexibly and efficiently
  4. Javascript date parsing and formatting, Part 2
  5. How to write unit tests for ease of refactoring