@tanzanite/simplify-number
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

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: type number. example: 1000
  • config: type object.
    • abbrev: type array. default: ['k', 'm', 'b', 't']
    • decimal: type number. default: 2

License

MIT Copyright (c) 2018 - MH Rohman Masyhar

Readme

Keywords

none

Package Sidebar

Install

npm i @tanzanite/simplify-number

Weekly Downloads

1

Version

2.0.1

License

MIT

Unpacked Size

9.41 kB

Total Files

8

Last publish

Collaborators

  • ironm00n