commafy

Add commas to a number

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
commafy
0.0.62 years ago8 years agoMinified + gzip package size for commafy in KB

Readme

commafy
Add commas to a number.

Install

npm install commafy

Usage

var commafy = require('commafy')

console.log(commafy(1000000)) // '1,000,000'
console.log(commafy(1000)) // '1,000'
console.log(commafy(1000.123)) // '1,000.123'
console.log(commafy(100)) // '100'
console.log(commafy(1e4)) // '10,000'

License

MIT