currency-transformation
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i currency-transformation

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

61.5 kB

Total Files

21

Last publish

Collaborators

  • alivekeep