https://github.com/markmead/alpinejs-money
Format money through Alpine JS into any language and currency (works with Shopify settings) 💸
https://github.com/markmead/alpinejs-money
alpine-js alpinejs alpinejs-plugin javascript money shopify
Last synced: over 1 year ago
JSON representation
Format money through Alpine JS into any language and currency (works with Shopify settings) 💸
- Host: GitHub
- URL: https://github.com/markmead/alpinejs-money
- Owner: markmead
- License: mit
- Created: 2021-12-29T21:24:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-07T08:12:50.000Z (over 1 year ago)
- Last Synced: 2025-03-16T07:41:20.131Z (over 1 year ago)
- Topics: alpine-js, alpinejs, alpinejs-plugin, javascript, money, shopify
- Language: JavaScript
- Homepage: https://js.hyperui.dev/examples/utility-format-currency
- Size: 33.2 KB
- Stars: 38
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Alpine JS Money
Format money through Alpine JS into any language and currency 💸
## Install
### With a CDN
```html
```
### With a Package Manager
```shell
npm install -D alpinejs-money
yarn add -D alpinejs-money
```
```js
import Alpine from 'alpinejs'
import money from 'alpinejs-money'
Alpine.plugin(money)
Alpine.start()
```
## Example
### Basic
```html
```
### With Data Attributes
```html
```
### With Global
```html
```
This will look for `locale` and `currency` which is on the global `xMoney`
object.
```js
window.xMoney = {
locale: 'en-CA',
currency: 'CAD',
}
```
### With Shopify
```html
```
This will look for `Shopify.locale` and `Shopify.currency.active` which is on
the global `Shopify` object.
If this isn't set by default then you can set it like this.
```js
window.Shopify = {
locale: 'en-CA',
currency: {
active: 'CAD',
},
}
```
### Stats



