forex
forex(amount: number, origin: text, destination: text, d: date) 🡒 number, pure function
Returns the amount
expressed in the currency origin
into the equivalent amount in the currency destination
according to the historical rates at the specified date d
.
The currencies should be encoded with their canonical three-letter codes. Lokad supports about 30 currencies leveraging the data provided by the European Central Bank. Rates are mostly updated on a daily basis.
table T = with
[| as Year |]
[| 2016 |]
[| 2017 |]
[| 2018 |]
[| 2019 |]
[| 2020 |]
show table "1 USD in EUR" a1b6 with
forex(1, "USD", "EUR", date(T.Year, 1, 1))