short-number
v1.0.7
Published
Turn a long number into a short one to improve readability, like 23634 => 23.6K
Downloads
7,606
Maintainers
Readme
short-number
Turn a long number into a short one to improve readability.
Installation
$ npm install --save short-number
Or with bower:
$ bower install short-number
Usage
var shortNumber = require('short-number');
shortNumber(5432);
//=> 5.4K
shortNumber(1236903);
//=> 1.2M
Supports numbers up to 1e18
.
License
MIT © Jonathan Svärdén