$ npm install comma-number
var commaNumber = require('comma-number')
commaNumber(1000) // "1,000"
commaNumber(-1000) // "-1,000"
commaNumber(-1000, '.') // "-1.000"
Parameters:
- number : {(Number|String)} Number to format
- separator : {String} Value used to separate numbers
Returns:
- {String} Comma formatted number
$ npm test
MIT