Hi.
I read a range table in excel, which fill the values found in SAP.
Then it calculates the difference between what it was already on the excel file and what it got from SAP.
When reading the value, in a for each row activity, I save the value using:
CDbl(CurrentRow("Price in SAP")) - CDbl(CurrentRow("Price"))
But the result has several decimals. Visually it looks like it’s ok, but internally I don’t feel sure.
ex.
Second row the difference between 5.40-5.41 = -.01; but why UiPath calculated as -0.0099999999979 instead?
You have to put .ToString onto the end of each CurrentRow:
CDbl(CurrentRow("Price in SAP").ToString) - CDbl(CurrentRow("Price").ToString)
If the columns are already double, then you don’t need to CDbl them nor use the .ToString
As for why the result is coming out the way it does, what are the values of Price and Price in SAP? Just like Difference is rounded, those other two values may also be rounded.