add-commas

Add commas to a number

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
add-commas
1310.0.48 years ago9 years agoMinified + gzip package size for add-commas in KB

Readme

add-commas
Add commas to a number

Credit

Core logic adapted from this thread on Stack Overflow

Usage

var addCommas = require('add-commas');

// yes
addCommas(12345);   // 12,345
addCommas('12345'); // 12,345

// no
addCommas();        // throws Error
addCommas(123.45)   // throws Error
addCommas('dogs')   // throws Error

License

Go nuts.