@splash-cli/unit-formatter
v1.0.1
Published
Format numbers by adding 'b/k/m' at the end. 1000 => 1k
Downloads
2
Maintainers
Readme
unit-formatter
Format numbers by adding 'b/k/m' at the end. 1000 => 1k
Install
$ npm install @splash-cli/unit-formatter --save
#or
$ yarn add @splash-cli/unit-formatter
Usage
import uFormatter from '@splash-cli/unit-formatter';
console.log( uFormatter(1000) ); //=> '1k'
Api
uFormatter(num)
Returns formatted number into a string.
num
Type: Number
Number to be formatted
License
MIT © Federico Vitale