EXCHANGE - Convert a value between two currencies (Reports & Settings Report Generator function)

From Catalyst
Jump to: navigation, search

Syntax

$EXCHANGE{amount, currency1, currency2, date}

Description

This function converts an amount from currency1 to currency2 using the exchange rates in effect on the date specified.

If either of the two currencies does not exist, or if rates between the two currencies do not exist on the date specified, then the value returned will be zero.


Parameters

amount
A numeric parameter that can not be omitted.
The amount to convert.
currency1
A text parameter that can be omitted.
The source currency: the currency to convert the amount from. If omitted then the System Base Currency is assumed.
currency2
A text parameter that can be omitted.
The destination currency: the currency to convert the amount to. If omitted then the System Base Currency is assumed.
date
A numeric parameter that can be omitted.
The exchange rates in effect on this date are used for the conversion. If omitted then the current User Date is used.

Returns

A numeric value. The converted amount, rounded to the nearest sub-unit of the destination currency.