Number Label

Convert a large number to nice formatted string.
Features
- No dependencies
- Easy to Use
- Use the International System of Units (SI)
Installation
Module available through the
npm registry. It can be installed using the
npm
or
yarn
command line tools.
npm install numberlabel --save
yarn add numberlabel
Usage
const label = require('numberlabel')
label.amounts
label.convert(1567000, 'name')
label.convert(1567000, 'symbol')
label.convert(1567000, 'prefix')
label.convert(100, 'prefix', {start: 500})
label.convert(100, 'prefix', {start: 500, toFixed: 4})
label.convert(100, 'prefix', {start: 500, toFixed: 4})
label.convert(0.00101)
label.getLabel(100, {type: 'prefix'})
Tests
To run the test suite, first install the dependencies, then run test
:
npm test
yarn test
Dependencies
None
Related
- bytelabel: convert byte lengths into a nice formatted string
Contributors
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. List of all contributors.
License
MIT © Tiago Danin