simplify-number
v1.0.0
Published
Simplify Number
Downloads
51
Readme
Simplify Number
Simplify number
How to install
- via npm:
npm install --save simplify-number
- via yarn:
yarn add simplify-number
Usage
// ES6+ Babel
// Typescript
import SimplifyNumber from 'simplify-number'
// CommonJS
const SimplifyNumber = require('simplify-number').default
console.log(SimplifyNumber(1000)) // it's return 1k
API
SimplifyNumber(number, config)
number
: typenumber
. example:1000
config
: typeobject
.abbrev
: typearray
. default:['k', 'm', 'b', 't']
decimal
: typenumber
. default:2
LINCESE
MIT Copyright (c) 2018 - MH Rohman Masyhar