https://github.com/torann/jquery.currency
Quick and dirty currency formatter.
https://github.com/torann/jquery.currency
Last synced: about 1 year ago
JSON representation
Quick and dirty currency formatter.
- Host: GitHub
- URL: https://github.com/torann/jquery.currency
- Owner: Torann
- License: other
- Created: 2017-11-08T19:27:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-29T20:38:34.000Z (about 8 years ago)
- Last Synced: 2025-02-15T05:43:43.921Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jQuery Currency
Quick and dirty currency formatter that ties into the currency format features in Laravel Currency.
## Default Format
Overriding the default currency format:
```javascript
$.setCurrencyOptions({
defaultFormat: '1.0,00 €'
});
```
## Formatting
```
$.formatCurrency(:value, :format, :onlyNumbers)
```
**Arguments**
- `:value` - the float amount to convert
- `:format` - the currency format (if empty the default value will be used)
- `:onlyNumbers` - when _true_ it will return formatted value without the currency symbol
## Data-API
For real-time formatting of during a blur event trigger, use the `data-format-currency` attribute.
Format the input using the default currency format:
```html
```
Override the default currency format:
```html
```