I have the problem, that since today calculating two numbers does not work anymore
1417,63 + 52,24 = 1469.8700000000001
I will read both values from a datatable and add them. The values are strings that I convert to doubles.
(convert.TODouble(Betrag) + if(Gesamter_Betrag_Double = “”,0,convert.ToDouble(Gesamter_Betrag_double))).ToString
Is the calculation wrong or are you getting any error?
@Anil_G The calculation is wrong, since I get that as answer 1469.8700000000001 but would expect 1469.87. It concerns several projects in UiPath right now, which worked before.
it is not wrong or changed. As internally a double can lead to a more detailed fraction it can result to this value. Just use rounding or toString(“F2”) on the double result
I think it’s double type accuracy matter.
I guess you check it in Locals panel as the following.
In double type 1417,63 + 52,24 preciously is 1469.8700000000001 if we display 17 digits.
We can get it using the following expression.
The following post may help you.
It’s Double type accuracy matter.
For now, can you check the following?
In Double type, 153.9 is precisely 153.90000000000001,
and 153.89+0.01 is preciously 153.89999999999998, because of its accuracy.
We can check it using G specifier.
If we need to prevent this matter, we can use Decimal type.
The above D is literal for Decimal. Please see the following in details.
@Anil_G ok yes, thank you that was also my workaround
@ppr ok thanks but I just don’t understand why it worked out for months and now every single double calculation results in these values.
the visual of a number and the internal detail representation can be different
123.4500000000000000000000001 internally is very close to 123.45 and can be triggered by several factors out our control. We just can help the machine e.g. by rounding requests
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.