An open API service indexing awesome lists of open source software.

https://github.com/mayeedwin/pruned

Prune Number Counters
https://github.com/mayeedwin/pruned

counters mayeedwin npm npm-install numbers prune

Last synced: 5 months ago
JSON representation

Prune Number Counters

Awesome Lists containing this project

README

          

## Prune Number Counters

Basically, prune a.k.a abbreviate number counters for example **1,250,000** to **1.3M**

### Install Pruned

```bash
npm i pruned
```
### Import pruned in your react app

```js
import pruned from 'pruned';
```

### Require the pruned package

```js
const pruned = require('pruned');
```

### Pass in the number value

```js
let newRating = pruned.Number(value);
```

### Examples...

```js
let value = 5300;
let likes = pruned.Number(value); // Output : 5.3K
```