@techhof-ab/currency-converter
v2.0.0
Published
coding test
Downloads
2
Readme
Currency Converter
A library that convert amount to other currency with the rate of input date using exchangeratesapi.io API
Installation
yarn add @techhof-ab/currency-converter
Usage
import CurrencyConverter from '@snushof-ab/currency-converter';
const res = await CurrencyConverter(100, "USD", "CAD", "2011-06-03");
console.log(res);
Inputs
amount
- (Number) base amountcurrencyFrom
- (String) base currency codecurrencyTo
- (String) conversion currency codedate
- (String) base date
Output
- JSON formatted object with input data and converted base_amount
- example
{ date: '2011-06-03', base_currency: 'USD', base_amount: 100, conversion_currency: 'CAD', conversion_amount: 97.85 }
Test
yarn test