Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amirmahdyjebreily/numtofawordjs
Tool to convert numbers to Persian letters
https://github.com/amirmahdyjebreily/numtofawordjs
javascript npm-package number persian
Last synced: 5 days ago
JSON representation
Tool to convert numbers to Persian letters
- Host: GitHub
- URL: https://github.com/amirmahdyjebreily/numtofawordjs
- Owner: AmirMahdyJebreily
- License: mit
- Created: 2024-04-26T08:30:59.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-21T21:14:30.000Z (6 months ago)
- Last Synced: 2024-09-01T06:18:14.932Z (2 months ago)
- Topics: javascript, npm-package, number, persian
- Language: JavaScript
- Homepage:
- Size: 62.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# عدد به حروف فارسی | Number to Farsi Words
### ابزار تبدیل اعداد به حروف فارسی | Tool to convert numbers to Persian letters
ابزاری ساده با الگوریتم هایی برپایه ریاضیات برای تبدیل اعداد به حروف فارسی
A simple tool with algorithms based on mathematics to convert numbers into Persian letters## Installation | نصب کردن
Use the following command to install this package :
```bash
npm i num-to-fa-word-js
```
## Usage | استفاده
To use this package, just call the `toFaWord()` function :
```javascript
import 'num-to-fa-word-js';console.log(toFaWord(12)) // دوازده
console.log(toFaWord(12.4)) // دوازده و چهار دهم
console.log(toFaWord(12.04)) // دوازده و چهار صدم
console.log(toFaWord(12.004)) // دوازده و چهار هزارم
console.log(toFaWord(12.0004)) // دوازده و چهار ده هزارم
console.log(toFaWord(12.00004)) // دوازده و چهار صد هزارم
// ...
console.log(toFaWord(12_000)) // دوازده هزار
console.log(toFaWord(12_000_000)) // دوازده میلیون
console.log(toFaWord(12_000_000_000)) // دوازده میلیارد
console.log(toFaWord(12_000_000_000_000)) // دوازده تریلیون
console.log(toFaWord(12_000_000_000_000_000)) // دوازده کوادریلیون
```
This package supports short scale prefix naming. You can also enter decimal and negative numbersI will be happy to make a pull request and create an issue! ❤️