number-to-persian
v1.0.5
Published
for converting number to persian letters
Downloads
31
Maintainers
Readme
Number To Persian - Conversion Number To Persian letters
Number To Persian provides the conversion of numbers into Persian letters easily In Java Script
Features
- it has Ability to process numbers up to 66 integers and 11 decimal places
- It can be used as modular package and CND or external library
Attention
For numbers greater than 14 digits, you must use the string data type
Browser Support
| | | | | | | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | :----------------------------------------------------------- | | 22✔ | 20✔ | 5.1✔ | 12.1✔ | 12✔ | 9✔ |
Installation
NPM
npm install number-to-persian
Usage
Modular Package
import numberToPersian from 'number-to-persian';
OR
const numberToPersian = require('number-to-persian');
console.log(numberToPersian(123)); //output: یکصد و بیست و سه
External Library
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/numberToPersian.min.js"></script>
<script>
console.log(numberToPersian(123)); //output: یکصد و بیست و سه
</script>
CDN
https://cdn.jsdelivr.net/npm/[email protected]/dist/numberToPersian.min.js
Example
you can call numberToPersian(num)
or use .numberToPersian()
prototype
// Function
numberToPersian(123); //output: یکصد و بیست و سه
//String Prototype
"123".numberToPersian(); //output: یکصد و بیست و سه
//Non-Digits
"1,23".numberToPersian(); //output: یکصد و بیست و سه
//Number Prototype
(2000).numberToPersian(); //output: دوهزار
//Float
(2000.3333).numberToPersian(); //output: دو هزار ممیز سه هزار و سیصد و سی و سه ده هزارم
//Negative numbers
(-123).numberToPersian(); //output: منفی یکصد و بیست و سه
تبدیل عدد به حروف فارسی در جاوا اسکریپت
توانایی پردازش اعداد تا 66 رقم عدد صحیح و 11 رقم اعشار | دسیلیارد