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

1.0.0 • Public • Published

Simplify Number

Greenkeeper badge Build Status

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

LINCESE

MIT Copyright (c) 2018 - MH Rohman Masyhar

Readme

Keywords

none

Package Sidebar

Install

npm i simplify-number

Weekly Downloads

11

Version

1.0.0

License

MIT

Unpacked Size

11.5 kB

Total Files

14

Last publish

Collaborators

  • rohmanhm