exchange-rate-api

An API wrapper around exchangeratesapi.io

Author:
  • over-engineer
Source:

Classes

ExchangeRates

Methods

(inner) convert(amount, fromCurrency, toCurrency, dateopt) → {number}

Convert the given amount from one currency to another using the exchange rate of the given date

Source:
Parameters:
Name Type Attributes Default Description
amount number

The amount to convert

fromCurrency string

Which currency to convert from

toCurrency string

Which currency to convert to

date Date | string <optional>
'latest'

The date to request the historic rate (if omitted, defaults to 'latest')

Returns:
Type:
number

The converted amount

(inner) exchangeRates() → {ExchangeRates}

Return a new instance of ExchangeRates

Source:
Returns:
Type:
ExchangeRates

A new instance of ExchangeRates