v-curr

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

Usage no npm install needed!

<script type="module">
  import vCurr from 'https://cdn.skypack.dev/v-curr';
</script>

README

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
});