Socket
Socket
Sign inDemoInstall

human-readable-numbers

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    human-readable-numbers

Print numbers in human readable format.


Version published
Weekly downloads
2K
increased by14.05%
Maintainers
1
Install size
4.78 kB
Created
Weekly downloads
 

Readme

Source

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 numberTo string
00
120120
50005k
1234512.3k
18000001.8M
129500000130M
35e+13350T
1.5e+241.5Y
0.95950m
0.0006600µ
15e-8150n
4.5e-244.5y
-30-30
-9500-9.5k
-17e-10-1.7n
4.567e+274570Y

Keywords

FAQs

Last updated on 02 Feb 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc