adamwdraper/Numeral-js — pull request #24 by michaelphines (2012-11-20 04:10:17+00:00)
Title: Allow for conditional precision with [.]

As the test cases show, it allows for formats like this:

numeral(10000) .format('0[.]00') === '10000'
numeral(10000.1) .format('0[.]00') === '10000.10'
numeral(10000.123).format('0[.]00') === '10000.12'
numeral(10000.456).format('0[.]00') === '10000.46'
numeral(10000.001).format('0[.]00') === '10000'

Primarily this is so we can support formatting money, but only showing the decimal portion when necessary.