npm.io
0.2.0 • Published 7 years ago

v-curr

Licence
MIT
Version
0.2.0
Deps
1
Size
8 kB
Vulns
0
Weekly
0
Stars
1

v-curr

Simple vue directive that works as a wrapper for currency.js

Instalation

  1. Install the plugin

npm install --save v-curr

  1. Add the plugin into your app:
import Vue from 'vue'
import VCurr from 'v-curr';

Vue.use(VCurr);

Usage

<span v-curr="10000"></span>

It goint to be render as...

<span>$10.000</span>

Or any other format that you want

Options

To customize the output just pass an object as a 2nd argument of Vue.use .

For all the available options please check https://github.com/scurker/currency.js#options

import Vue from 'vue'
import VCurr from 'v-curr';

Vue.use(VCurr, {
    separator: '.',
    precision: 0,
    formatWithSymbol: true
});