1.2.0 • Published 2 years ago

readable-num v1.2.0

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

readable-num

A simple npm package that turns numbers into easy to read words.

Usage

const { readableNum } = require("readable-num");

const number = 67567654;

readableNum(number); // 67.6 million
readableNum(number, { minNum: 999999999 }); // 67567654
readableNum(number, { precision: 2 }); // 68 million
readableNum(number, { minNum: 100, precision: 2 }); // 68 million

Parameters

  • num (required) - the number to process into a readable string
  • config (optional): options for the function
    • minNum: the smallest number that will be converted into a readable string (default: 9999)
    • precision: the number of significant digits that will be used for the readable string (default: 3)
    • allowDecimal: whether or not the number in the readable number can have a decimal or not (default: false)
1.2.0

2 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago