1.1.1 • Published 5 years ago

@chatfoodio/vue-currency v1.1.1

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

Vue currency

Developed and maintained by and for ChatFood 😉

Build Status

Usage

# install package
npm install @chatfoodio/vue-currency --save

Currency settings available (ISO_CODE): BRL, AED, USD, TRY

import Vue from "vue";
import ChatfoodCurrency from "@chatfood/vue-currency";

// Default Currency Settings
const settings = {
  symbol: "$",
  thousand: ",",
  precision: 2,
  decimal: ".",
  symbolFirst: true,
  symbolSeparator: " "
}

Vue.use(ChatfoodCurrency, settings); 
// or Vue.use(ChatfoodCurrency); 

// Set settings on the fly anywhere inside your components
this.$currency.setConfig("ISO_CODE");

// Set settings on the fly anywhere on your project
Vue.currency.setConfig("ISO_CODE");

// Get current settings
Vue.currency.getConfig();
<template>
  <!-- $ 12.43 -->
  <p>{{ 12.43 | currency }}</p>
  
  <!-- AED 12.43 -->
  <p>{{ 12.43 | currency({ symbol: "AED" }) }}</p>
  
  <!-- 12.43 -->
  <p>{{ 12.43 | currency({ symbol: "" }) }}</p>
  
  <!-- $ 12.4 -->
  <p>{{ 12.43 | currency({ precision: 1 }) }}</p>
  
  <!-- $ 12 -->
  <p>{{ 12.43 | currency({ precision: 0 }) }}</p>

  <!-- $ 3.412,43 -->
  <p>{{ 3412.43 | currency({ thousand: ".", decimal: "" }) }}</p>
</template>

Contribution

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build your for production
npm run build

# run unit tests
npm run test

# publish library on NPM (Check your version first before publish.)
npm publish
1.1.1

5 years ago

1.1.0

5 years ago

1.0.10

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago