Number formatter
Format number to string by pattern.
Install
$ npm install --save simple-number-formatter
Usage
format(number, pattern, options)
var format = ; ;//=> '0.23000' ;//=> '0.23' ;//=> '10000' ;//=> '+10,000' //=> -.23 //=> '3.1416' ;//=> '3.1415'
See tests for more details.
Available options
thousandsDelimeter // default: ''
decimalDelimeter // default: '.'
roundingFunction // default: Math.round
License
MIT © Dmitry Semigradsky