Tutorials & Examples Web-help Blog

Obtaining currency exchange rates in EasyMorph


#1

Converting amounts from one currency to another currency is a frequent task, especially for our users in Europe. Here are two re-usable projects that automatically obtain historical exchange rates from the European Central Bank:

euroconvert.morph
Calculates cross-rates for all currencies in the ECB data for the specified date. In a sense, it’s equivalent to the EUROCONVERT function in Excel.
euroconvert.morph (13.9 KB)

Usage: specify the date in the ISO format (e.g. 2019-01-19).
image
image

The project can be used in iterations too. In this case date can be specified either as a number date, or a text date in the ISO format.

fx-rate.morph
Returns historical exchange rates for the specified date range. By default, the rates are relative to EUR. Optionally, another base currency can be specified (e.g. USD) and the rates will be relative to that base currency.
fx-rate.morph (15.4 KB)

Usage: specify the lower and upper boundary of the date interval in the ISO format (e.g. 2019-01-19).
Optionally specify a base currency (if left empty then all rates will be relative to EUR).


image

The project can be used in iterations too. In this case the dates can be specified either as a number date, or a text date in the ISO format.

Example
example.morph (5.1 KB)


Formula for currency converter