If-then activity of float

I would like to set an if-then activity. When variable “today_int” is greater than “three_int”, then variable “real_answer” will be string increase.

Variable “three_int” is float (95.53)
Variable “today_int” is float (63.53)

The correct output for real_answer should be decreased. However, I use a message box to test, the box shows an increase.

Can I know how to solve this? Thank you.

You named your variables today_int and three_int and then are trying to use float values. INTegers don’t hold decimals (float values). Integers only hold whole numbers.

Are your variables defined as int? You should be using double or decimal.

Hi, thank you for your reply. The variables are double.

Then I suggest putting a breakpoint on the If, run in Debug mode, and see what the value of those variables actually is.

Hi @postwick

If you can choose the double. it will work correctly.

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