Oracle BPEL adds extra digits in decimal value

1k views Asked by At

I have following expression in Oracle bpel 11g.

number(bpws:getVariableData('recommendedDeposit')) + number(bpws:getVariableData('delinquentTotalAmount')) + number(bpws:getVariableData('reconnectFee'))

Values of the 3 variables are

recommendedDeposit = 0
delinquentTotalAmount = 105.27
reconnectFee = 50

Addition of all 3 should be 155.27.

I am assigning the result to a variable var1.

After the assign activity result shows as 155.26999999999998.

What is problem here?

How can I get correct result of 155.27?

1

There are 1 answers

0
Wanderley On

You can use format-number function within XSLT transformation.

<xsl:value-of select="format-number($variable, precision)" />