# human-readable-numbers

> Print numbers in human readable format.

Latest version **0.9.5** (published 2019-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install human-readable-numbers
pnpm add human-readable-numbers
yarn add human-readable-numbers
bun add human-readable-numbers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.5 |
| Published | 2019-02-02 |
| First published | 2018-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Antony Belov |
| Maintainers | cerberus.ab |
| Keywords | human, readable, numbers |

## Links

- npm: https://www.npmjs.com/package/human-readable-numbers
- Repository: https://github.com/cerberus-ab/human-readable-numbers
- Homepage: https://github.com/cerberus-ab/human-readable-numbers#readme
- Issues: https://github.com/cerberus-ab/human-readable-numbers/issues
- npm.io page: https://npm.io/package/human-readable-numbers

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.9.5 (latest) — 2019-02-02
- 0.9.4 — 2019-01-17
- 0.9.3 — 2018-09-29
- 0.9.2 — 2018-09-29
- 0.9.1 — 2018-09-29

## README

# Human Readable Numbers ![Build Status](https://travis-ci.org/cerberus-ab/human-readable-numbers.svg?branch=master)
Print numbers in human readable format according to [SI prefixes](https://physics.nist.gov/cuu/Units/prefixes.html) except *hecto*, *deka*, *deci* and *centi*.

## Installation
Using npm:
```bash
$ npm i --save human-readable-numbers
```

In a browser:
```html
<script src="dist/index.min.js"></script>
```

In node.js:
```javascript
var HRNumbers = require('human-readable-numbers');
```

Also the module exported as AMD module.

## Documentation
> string toHumanString(number)

Function prints numbers in human readable format.
```javascript
var string = HRNumbers.toHumanString(number);
```
Examples:

From number | To string
--- | ---
0 | 0
120 | 120
5000 | 5k
12345 | 12.3k
1800000 | 1.8M
129500000 | 130M
35e+13 | 350T
1.5e+24 | 1.5Y
0.95 | 950m
0.0006 | 600µ
15e-8 | 150n
4.5e-24 | 4.5y
-30 | -30
-9500 | -9.5k
-17e-10 | -1.7n
 4.567e+27 | 4570Y

---
_Source: https://npm.io/package/human-readable-numbers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
