human-readable-numbers
Print numbers in human readable format.
Last updated 6 years ago by cerberus.ab .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install human-readable-numbers 
SYNC missed versions from official npm registry.

Human Readable Numbers Build Status

Print numbers in human readable format according to SI prefixes except hecto, deka, deci and centi.

Installation

Using npm:

$ npm i --save human-readable-numbers

In a browser:

<script src="dist/index.min.js"></script>

In node.js:

var HRNumbers = require('human-readable-numbers');

Also the module exported as AMD module.

Documentation

string toHumanString(number)

Function prints numbers in human readable format.

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

Current Tags

  • 0.9.5                                ...           latest (6 years ago)

5 Versions

  • 0.9.5                                ...           6 years ago
  • 0.9.4                                ...           6 years ago
  • 0.9.3                                ...           6 years ago
  • 0.9.2                                ...           6 years ago
  • 0.9.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |