The information in this article applies to:
Product: Metastorm BPM (e-Work)
Version: 6.x 7
Issue
To calculate expenses, the following formula is executed when a button is pressed on a form:
%Expense:=(currency)%ExchangeRate\*%Currency1
%Expense is a currency data type with 2 decimal places.
%ExchangeRate is a real data type with 5 decimal places.
%Currency1 is a currency data type with 2 decimal places.
The following example shows the result when the formula is executed.
%Currency1 = 10,000
%ExchangeRate = 0.00005
Instead of the expected result of 0.50, the formula returns a value of 1.00
Resolution
The currency data type store values in the standard 19,4 fixed point format. This is supported by COM, SQL Server (money data type), and Oracle (NUMBER(19,4)). In this example, a currency value is being multiplied by a floating point (real) value. If %ExchangeRate is cast as currency before the calculation, as is done in the formula above, the value is converted to 4 decimal places before the calculation and 0.00005 becomes 0.0001. This gives a final result of 1.00.
In this case, the following formula will give the expected result:
%Expense:=%ExchangeRate\*(Real)%Currency1.