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