1.0.0 • Published 9 months ago

num-to-hindi-word v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

num-to-hindi-word

An simple module to convert numbers to words for South Asian numbering system.

Install

npm i num-to-hindi-word

Example

1          ->  एक
12         ->  बारह
123        ->  एक सौ तेईस
1234       ->  एक हज़ार दो सौ चौंतीस
12345      ->  बारह हज़ार तीन सौ पैंतालीस
123456     ->  एक लाख तेईस हज़ार चार सौ छप्पन

Usage

const numWordsHindi = require('num-to-hindi-word')

const amountInWords = numWordsHindi(12345) // Example output: बारह हज़ार तीन सौ पैंतालीस

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.

1.0.0

9 months ago