Currency formatting for all currencies, and all languages. As a simple Vue plugin.
npm install vue-mny --save
const vueMny = require('vue-mny');
Vue.use(vueMny, {
locale: 'en-US',
currency: 'USD',
currencyDisplay: 'symbol',
});
<span v-mny="moneyVariable"></span>
<span v-mny="{ input: moneyVariable, currency: 'EUR' }"></span>
// shorthand:
<span v-mny.code="moneyVariable"></span>
{
locale: 'en-US',
currency: 'USD',
currencyDisplay: 'symbol',
}
default: en-US
A string with a BCP 47 language tag.
default: USD
Possible values are the ISO 4217 currency codes, such as USD
for the US dollar, EUR
for the euro, or CNY
for the Chinese RMB.
default: symbol
How to display the currency in currency formatting. Possible values are symbol
to use a localized currency symbol such as €, code
to use the ISO currency code, name
to use a localized currency name such as dollar
.
version 0.3.1
- Patch
version 0.3.0
- Major improvements...