Trying to compare a % value in an if statement

In the image I am comparing 2 string to see if they match, the percentage is less then 80% but the automation is getting to the wrong area of the if statement? Not sure why this if is not working?

remove that *100 from if condition
the value of AddResults=0.61111
and when you multiply by 100 you get 61.11 which is >0.83 so it goes to the true part of if case
Hope it helps :slight_smile:

1 Like

Hi @jeff.shubzda ,

If you want the comparison to work as expected, then they must share the same decimal places.
In this case, since you are multiplying by 100, you have to multiply the LHS by 100 as well →

AddResult*100 >=0.83*100

Obviously, we can get rid of the multiplication entirely and only use it while logging information in the Log Message Activity, if that is why you were multiplying it.

AddResult >=0.83

Kind Regards,
Ashwin A.K

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.