1.0.2 • Published 4 years ago

currency-transformation v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Currency transformation util

Installation

yarn add currency-transformation

How to usage

import { CurrencyTransformation, CurrencyList } from 'currency-transformation';

const currencyTransformation = new CurrencyTransformation();

const amount = currencyTransformation.convert({
  amount: 100,
  from: CurrencyList.USD,
  to: CurrencyList.UAH,
  baseCurrency: CurrencyList.UAH, // should be 1 as value in rates list
  moneyFormat: true,
  crossFormat: false,
  rates: {
    EUR: 29.67359,
    GBP: 33.4715,
    RUB: 0.37,
    USD: 27.17391,
    UAH: 1
  }
});

console.log(amount);
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago