JSPM

add-commas

0.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 400
  • Score
    100M100P100Q122712F
  • License MIT

Add commas to a number

Package Exports

  • add-commas

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (add-commas) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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.