ConvertCurrency

Mon 01 January 2018

Syntax

ConvertCurrency(amt, currency_cd, exchng_to_currency, exchng_rt_type, effdt, converted_amt [, error_process [, round] [, rt_index]])

Description

Use the ConvertCurrency function to convert between currencies. The result of the conversion is placed in a variable passed in converted_amt .

Parameters

Field or Control

Definition

Amt

The currency amount to be converted.

Currency_cd

The currency in which the amt is currently expressed.

Exchng_to_currency

The currency to which the amt should be converted.

Exchng_rt_type

The currency exchange rate to be used. This is the value of the RT_TYPE field in the RT_RATE table of RT_DFLT_VW.

Effdt

The effective date of the conversion to be used.

Converted_amt

The resulting converted amount. You must supply a variable for this parameter. If a conversion rate cannot be found, converted_amt is set equal to amt.

Error_process

An optional string that, if specified, contains one of the following values:

  • "F" - Produce a fatal error if a matching conversion rate is not found.

  • "W" - Produce a warning message box if a matching conversion rate is not found.

  • "I" - Or other−return without producing a message box

If error_process is not specified, it defaults to Fatal ("F").

Round

Optional Boolean value indicating whether to round converted_amt to the smallest currency unit. If omitted, round defaults to False.

rt_index

An optional string to indicate which exchange rate index should be used to retrieve the exchange rate. If omitted, the Default Exchange Rate index (as specified on the Market Rate index definition) is used.

Note: If the currency exchange rate is changed in a PeopleSoft table, this change will not be reflected in an already open page until the user closes the page, then opens it again.

Returns

ConvertCurrency returns a Boolean value where True means a conversion rate was found and converted_amt calculated, and False means a conversion rate was not found and a value of one (1) was used.