@tanzanite/simplify-number
v2.0.1
Published
Simplify Number
Downloads
25
Readme
Simplify Number
Simplifies large numbers.
How to install
yarn add @tanzanite/simplify-number
Usage
// ESM only
import simplifyNumber from "@tanzanite/simplify-number";
console.log(simplifyNumber(1000)); // 1k
API
simplifyNumber(number, config);
number
: typenumber
. example:1000
config
: typeobject
.abbrev
: typearray
. default:['k', 'm', 'b', 't']
decimal
: typenumber
. default:2
License
MIT Copyright (c) 2018 - MH Rohman Masyhar