Skip to main content
Solved

Conditional if makes a substration of two variables, but from time to time, the result is "-0.00". how do I fix this?


I made a conditional interaction of two booleans that, when true, a substraction of two number variables occur:

if boolean1 == true and boolean 2 == true

numberVariable3 == numberVariable2 - numberVariable1

later I check numberVariable3 and if it equals to 0.00 then it should proceed to navigate to another artboard.

if numberVariable3 == 0

navigate to Artboard1

problem is, after random clicks of the booleans, the substraction stops working and it shows “-0.00” …thus because it does not equal to 0, it never takes me to artboard1. Why is it happening?

additionally to this, is not like i can correct it with another conditional statement. I tried putting a " if numberVariable3 == -0.00 but it does not accept the negative number. it takes it as an operator and thus, it thinks the statement is incomplete.

any ideas? I will appreciate a lot the help.

Best answer by Lucy13

but i did fix it by just relaying the conditional on the booleans equal to true, instead of the variable equaling to 0. it was a workaround.

View original
This topic has been closed for replies.

3 replies

Nate_G
  • Power Member
  • 180 replies
  • October 16, 2023

@Lucy13 You could try using <= 0 instead of ==0

That way your conditional will still function if the number goes into the negative.


  • Author
  • 5 replies
  • October 17, 2023

sadly this didn’t work either…I don’t understand why though…


  • Author
  • 5 replies
  • Answer
  • October 17, 2023

but i did fix it by just relaying the conditional on the booleans equal to true, instead of the variable equaling to 0. it was a workaround.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings