https://github.com/tayeb-ali/num-arabic-words
https://github.com/tayeb-ali/num-arabic-words
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tayeb-ali/num-arabic-words
- Owner: Tayeb-Ali
- License: mit
- Created: 2021-02-06T16:37:44.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-14T02:12:15.000Z (about 1 year ago)
- Last Synced: 2024-11-02T03:35:46.833Z (12 months ago)
- Language: JavaScript
- Size: 75.2 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# num-words
An simple module to convert numbers to words for Arabic numbering system. e.g. الف و المليون و المليار
# Install
```js
npm i num-arabic-words
```# Example
```js
1 -> واحد
12 -> اثني عشر
123 -> مئة وثلاث وعشرون
1234 -> ألف و ومئتان و اربع وثلاثون
12345 -> اثنا عشر ألفاً وثلاثمائة و خمس واربعين
```# Usage
```js
const numWords = require('num-arabic-words')const amountInWords = numWords(12345) // اثنا عشر ألفاً وثلاثمائة و خمس واربعين
```
## TypeScript:
```ts
import {numWords} from num-arabic-words;const amountInWords = numWords(12345); // اثنا عشر ألفاً وثلاثمائة و خمس واربعين
```_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.