Displays a stylable money amount and currency according to the user's preferred formatting.
yarn add vue-money-amount
npm i --save vue-money-amount
import VueMoneyAmount from 'vue-money-amout';
Vue.component('vue-money-amout', VueMoneyAmount);
<money-amount :amount="amount" :currency="currency" :locale="locale" />
Props | Type | Required | Default |
---|---|---|---|
amount | Float | true | - |
currency | String | true | - |
locale | String | no | User locale |
isFractionated | Boolean | no | true |
minimumFractionDigits | Int | no | 0 |
hasColors | Boolean | no | true |
The isFractionated
prop defines if the amount prop value is already fractionated or not.
Eg.
- If the
amount
is4284
andisFractionated
istrue
, it will display:42.84
- If the
amount
is4284
andisFractionated
isfalse
, it will display:4284
The minimumFractionDigits
prop defines the minimum number of decimal digits.
Eg.
- If the
amount
is4284
,minimumFractionDigits
is3
, it will display:42.840
yarn
yarn build
yarn lint
yarn storybook
This project is licensed under MIT License