jQuery Plugin To Convert English Numbers To Persian - persianumber

jQuery Plugin To Convert English Numbers To Persian - persianumber
File Size: 4.01 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

persianumber is a lightweight (~2kb) jQuery plugin used to convert English numbers to Persian or Arabic numerals.

How to use it:

1. Load the jQuery javascript library and persianumber.js before the closing </body> tag.

<script src="jquery.min.js"></script>
<script src="persianumber.js"></script>

2. Wrap the English numbers in an Html element.

<div class="demo">  
  123456789
</div>

3. Convert the numbers to Persian.

$(document).ready(function(){
  $('.demo').persiaNumber();  
}); 

4. Convert the numbers to Arabic.

$(document).ready(function(){
  $('.demo').persiaNumber('ar');  
}); 

Changelog:

2019-03-19

  • Update andSelf()
  • Update addBack()

2015-01-03

  • Null string error resolution

This awesome jQuery plugin is developed by mhosseinalizadeh. For more Advanced Usages, please check the demo page or visit the official website.