Digit Convertor
a lightweight library for projects that allow you to parse the digits inside of your strings to persian and vice versa.
Installation
run one of these commends on your project root:
npm install persian-digit-tools --saveyarn add persian-digit-toolsbower install persian-digit-tools --save
Usage
first, you must import it
Javascript
var convertor = DigitConvertor;
Typescript
;
then you can use it like this:
;console.logconvertor.toPersianstr; // it will print 'hello ۱۲۳.sda۳۱ this۱۲۳۳is a complex ۱' ;console.logconvertor.toEnglishstr; // it will print '123456 3213 64123,231'
Test
you can see test inside of test folder and for run tests use this command:
npm run test
Contribute
feel free to fork and do what ever you want (or send pull requests).
for contribute this project, first clone the project and go to project folder:
git clone https://github.com/MetaiR/persian-digit-tools.gitcd persian-digit-tools
then run:
npm install
after that you ready to go :D