How to write a if statement based on percentage

Here is the concept, I am running a fuzzy logic application that is giving me a number value of 0.834620237350464 for a match. it writes to a variable of ResultsTwo what I can’t get to work is the if condition statement not sure how to write it so that if this number is higher then 80% > then do this

Are you looking for this?
grafik

is that how you would write it? Would I use the variable of ResultsTwo.#value * 100 < 80

what datatype is it? Maybe you share some screenshot from the relevant parts from the flow.

in general yes: YourNumberVariable * 100 < 80

can you please answer?

Your if then else reults are swithced around. You state if resultstwo > 0,8 then writeline less than 80.

> means greater then… so switch the then and else sub-sequences around and you have it correct.

1 Like

the variable is a double

then it should work, try it
But as mentioned by Jeroen swap the branches or adopt the condition

1 Like

you have your condition the other way around, you’r asking if your variable is greater than 0.8 then print that it is less, else is more than 80, you might change the write line to the other side for bot then and else, or change the > conditional to <

also use the solution that @ppr gives to you, it would work, you are just missing the condition that you have it in the other way around

1 Like

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