number-with-commas

1.1.0 • Public • Published

number-with-commas

Convert a Number to a string with commas.

by Luis Eduardo Rojas Cabrera

Travis Codecov Status npm package npm downloads license

Dependency Status devDependency Status peerDependency Status

Installation

$ npm install number-with-commas --save

Quick DEMO on tonicdev

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).

CHANGELOG

LICENSE

MIT: http://michaelhsu.mit-license.org

Package Sidebar

Install

npm i number-with-commas

Weekly Downloads

38

Version

1.1.0

License

MIT

Last publish

Collaborators

  • evenchange4