num-words
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

num-words

An simple module to convert numbers to words for South Asian numbering system. e.g. Two crore four lakh.

Install

npm i num-words

Example

1          ->  one
12         ->  twelve
123        ->  one hundred and twenty three
1234       ->  one thousand two hundred and thirty four
12345      ->  twelve thousand three hundred and forty five
123456     ->  one lakh twenty three thousand four hundred and fifty six

Usage

const numWords = require('num-words')

const amountInWords = numWords(12345) // twelve thousand three hundred and forty five

Note: This module only supports 9 digits input. A typical usecase for such convertion is in tax invoices or charts etc. For that more than 9 digits input is not very common (and also not very readable).

Contributing

In case you notice a bug, please open an issue mentioning the input that has caused an incorrect conversion.

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i num-words

    Weekly Downloads

    10,474

    Version

    1.2.3

    License

    MIT

    Unpacked Size

    11.6 kB

    Total Files

    10

    Last publish

    Collaborators

    • salmanm