AAA
AAA

Reputation: 43

Oracle BPEL adds extra digits in decimal value

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?

Upvotes: 1

Views: 1067

Answers (1)

Wanderley
Wanderley

Reputation: 399

You can use format-number function within XSLT transformation.

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

Upvotes: 1

Related Questions