1.0.6 • Published 3 years ago

bigint2text v1.0.6

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

bigint2text

Description

Format any number up to novemnonagnonacentnonimillnonidecimillillion (10^300000)!

Example:

bigint2text({
  num: 123456789012345678901234567890123456789012345678901234567890n,
  variant: 'long',
  formatTriples: true,
});

produces:

'one hundred and twenty-three octodecillion four hundred and fifty-six septendecillion seven hundred and eighty-nine sexdecillion twelve quindecillion three hundred and fourty-five quattuordecillion six hundred and seventy tredecillion three hundred and fifty-six duodecillion three hundred and nineteen undecillion six hundred and six decillion four hundred and eighty-three nonillion nine hundred and eleven octillion two hundred and twenty-nine septillion six hundred and seventy-six sextillion one hundred and twenty-two quintillion four hundred and twenty-six quadrillion two hundred and two trillion five hundred and ninety-seven billion thirty-eight million seven hundred and fifty-one thousand seven hundred and fourty-four'

Installation

npm i bigint2text

or

yarn add bigint2text

CLI

To install:

npm i -g bigint2text
$ n2t --help
Usage: n2t -n [num] [-sf]

Options:
      --help           Show help                                                                     [boolean]
      --version        Show version number                                                           [boolean]
  -n, --num            Number to be formatted                                                         [string]
  -s, --short          If passed, variant will be `'short'` instead of `'long'`     [boolean] [default: false]
  -f, --formatTriples  If `true`, format each 3-digit. Default is `false`           [boolean] [default: false]

With stdin:

$ n2t
Enter an integer number: 123456789
123 million 456 thousand 789

With pipe:

$ echo 123456789 | n2t
123 million 456 thousand 789

With args:

$ n2t -n 123456789
123 million 456 thousand 789
$ n2t -n 123456789 -s
123 m 456 k 789
$ n2t -n 123456789 -f
one hundred and twenty-three million four hundred and fifty-six thousand seven hundred and eighty-nine
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago