This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

How to determine if a number variable is even or odd

Hi there,

I'm trying to build a flow in which Homey can determine if a better logic-variable (number, only integers) is odd or even. I tried it with a beter logic-card (math.js expression is true): math.isInteger (variable) and math.round(variable/2;0) - (variable/2) = 0. However, these expressions doesn't seem to work. Is there another expression I can use? Or is there another option to solve this "problem"?

Comments

Sign In or Register to comment.