Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mavihq/prial
currency formating library for javascript
https://github.com/mavihq/prial
currency persian rial toman
Last synced: 3 months ago
JSON representation
currency formating library for javascript
- Host: GitHub
- URL: https://github.com/mavihq/prial
- Owner: mavihq
- License: mit
- Created: 2017-05-31T13:24:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T13:41:44.000Z (over 7 years ago)
- Last Synced: 2024-04-24T19:24:01.617Z (7 months ago)
- Topics: currency, persian, rial, toman
- Language: JavaScript
- Size: 1.95 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-persian - prial - Currency formating library for javascript. (JavaScript)
README
# prial
currency formating library for javascript based on [rialjs](https://github.com/habibpour/rial.js) by [saeid habibpour](https://github.com/habibpour).## installation
### npm
`npm install prial --save`### yarn
`yarn add prial`## api
### Rial
```
import { Rial } from 'prial'
//or es5 model
const Rial = require('prial').Rialconst rial = new Rial({
decimal : ",",
alphabet : "fa",
currency : "هزار ریال",
cut : 3,
});rial.get("425420000000");
// ۴۲۵,۴۲۰,۰۰۰ هزار ریالrial.Alphabet("en").Currency("ریال").Cut(0).get("425420000000");
// 425,420,000,000 ریالrial.Decimal(".").Alphabet("en").Currency("").Cut(0).get("۴۲۵,۴۲۰,۰۰۰");
// 425.420.000
```### formatToman
```
import { formatTooman } from 'prial'
//or es5 model
const formatToman = require('prial').formatTomanformatToman('123456')
// 123,456 تومان
```