short-num
v0.2.0
Published
converts e.g. 12345 -> 12.35k
Downloads
3
Readme
Install
npm install --save short-num
Usage
var shortNum = require('short-num');
// shortNum(number, decimalPlaces, abbrev=[ "k", "m", "b", "t" ])
console.log(shortNum(12345, 2)) // => '12.35k'
Code from a StackOverflow question and then modified.