4 Replies Latest reply: Mar 30, 2015 4:31 PM by t h

# Expression returning wrong result

Hi,

Does anybody ever seen this problem?

Expression:

num([Valor Conta 2],'0.0') - rangesum(num([Valor Recebido 2],'0.0'),num([Valor Glosa 2],'0.0'),num([Valor Perda 2],'0.0'),num([VL_PAGO_RETORNO 2],'0.0'),num([VL_GLOSADO_RETORNO 2],'0.0'))

or

2266,15 - (2142,24+123,91) = 4,54747350..... should be zero!

• ###### Re: Expression returning wrong result

It is close enough to 0 - see this "e-013"

• ###### Re: Expression returning wrong result

The problem is that I have some conditions that depend on this result.

Do you have any tips on how to fix this?

• ###### Re: Expression returning wrong result

Maybe using round().  And no need for num() for each part, it is only for presentation but doesn't change underlying values.

round(
[Valor Conta 2] - rangesum([Valor Recebido 2], [Valor Glosa 2], [Valor Perda 2], [VL_PAGO_RETORNO 2], [VL_GLOSADO_RETORNO 2])
,0.01)

• ###### Re: Expression returning wrong result

Hi,

Try rounding to something reasonable.

Round(num([Valor Conta 2],'0.0'),0.001) -Round(rangesum(num([Valor Recebido 2],'0.0'),num([Valor Glosa 2],'0.0'),num([Valor Perda 2],'0.0'),num([VL_PAGO_RETORNO 2],'0.0'),num([VL_GLOSADO_RETORNO 2],'0.0')),0.001)