Convert from one currency to another, on a given date or using the latest available exchange rates.

Currency conversion is available on all paid plans.

fixer_convert(from, to, amount = 1, date = NULL)

Arguments

from

Symbol of currency to convert from.

to

Symbol of currency to convert to.

amount

The numeric value of the from currency to convert. Defaults to 1, and accepts integers greater than 0 and less than 100000.

date

Optional variable. A date in YYYY-MM-DD format, or any value that can be coerced to YYYY-MM-DD format with as.Date(). Defaults to NULL, which returns the latest conversion data.

Value

A list containing the value of the conversion, the exchange rate and the date and time of the currency conversion.

Examples

if (FALSE) {

x <- fixer_convert(from = "GBP", to = "JPY", amount = 25)

y <- fixer_convert(from = "GBP", to = "JPY",
                   amount = 25, date = "2018-05-05")

}