https://github.com/rohmanhm/simplify-number
:dizzy: Simplify your number
https://github.com/rohmanhm/simplify-number
number simplify typescript
Last synced: 10 months ago
JSON representation
:dizzy: Simplify your number
- Host: GitHub
- URL: https://github.com/rohmanhm/simplify-number
- Owner: rohmanhm
- License: mit
- Created: 2018-09-25T03:06:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-05T14:28:39.000Z (over 7 years ago)
- Last Synced: 2025-05-13T02:02:56.910Z (11 months ago)
- Topics: number, simplify, typescript
- Language: TypeScript
- Homepage:
- Size: 36.1 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simplify Number
[](https://greenkeeper.io/)
[](https://travis-ci.com/rohmanhm/simplify-number)
> Simplify number
## How to install
- via **npm**:
```bash
npm install --save simplify-number
```
- via **yarn**:
```bash
yarn add simplify-number
```
## Usage
```typescript
// ES6+ Babel
// Typescript
import SimplifyNumber from 'simplify-number'
// CommonJS
const SimplifyNumber = require('simplify-number').default
console.log(SimplifyNumber(1000)) // it's return 1k
```
## API
```typescript
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](http://opensource.org/licenses/MIT)
Copyright (c) 2018 - MH Rohman Masyhar