https://github.com/salmanm/num-words
Converts digits/numbers to words
https://github.com/salmanm/num-words
amount convert crore lakh number words
Last synced: 26 days ago
JSON representation
Converts digits/numbers to words
- Host: GitHub
- URL: https://github.com/salmanm/num-words
- Owner: salmanm
- License: mit
- Created: 2018-10-22T07:30:48.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-03-27T09:10:33.000Z (about 1 year ago)
- Last Synced: 2024-04-14T10:11:07.287Z (about 1 year ago)
- Topics: amount, convert, crore, lakh, number, words
- Language: JavaScript
- Homepage:
- Size: 212 KB
- Stars: 26
- Watchers: 3
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# num-words
An simple module to convert numbers to words for South Asian numbering system. e.g. Two crore four lakh.
# Install
```js
npm i num-words
```# Example
```js
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
```js
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.