Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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)

View solution in original post

4 Replies
Anonymous
Not applicable
Author

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

Not applicable
Author

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

Do you have any tips on how to fix this?

Anonymous
Not applicable
Author

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)

Not applicable
Author

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)