number-with-commas
v1.1.0
Published
Convert a Number to a string with commas.
Downloads
120
Maintainers
Readme
number-with-commas
Convert a Number to a string with commas.
Installation
$ npm install number-with-commas --save
Usage
import numberWithCommas from 'number-with-commas';
t.is(numberWithCommas(10000), '10,000');
t.is(numberWithCommas(-10000), '-10,000');
t.is(numberWithCommas(1000.1001), '1,000.1,001');
API
numberWithCommas(
x: number,
): string
Test
$ npm run lint
$ npm run test:watch
CONTRIBUTING
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests (
$ npm test
).