Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

short-number

cfj11.1kMIT1.0.7

Turn a long number into a short one to improve readability, like 23634 => 23.6K

number, shorten, simplify, readability, thousands, millions

readme

short-number Build Status npm version

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