commafy

0.0.6 • Public • Published

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

/commafy/

    Package Sidebar

    Install

    npm i commafy

    Weekly Downloads

    242

    Version

    0.0.6

    License

    MIT

    Unpacked Size

    4.77 kB

    Total Files

    8

    Last publish

    Collaborators

    • miguelmota