I have a global value.

How can I find out if this number is completely divisible by 60 or not?

While probably not that optimal, what I personally like to do, is to take the result of the division equation, convert it into a string, and use some text manipulation functions to determine if a “.” Exists in the string or not, if not, that means it was divided perfectly with no remainders.

2 Likes

Can you give me your case?

I’m still not understand how can I do this in my game.

You can use the modulo Mathematic function. In gdevelop x modulo n is written mod(x, n)

Modulo basically gives the rest of the euclidian division x/n

So if mod(Variable(yournumber), 60) = 0, it means yournumber is completely divisible by 60. (the rest of the euclidian division is null.

So you’d need the compare 2 values condition.

4 Likes