Hi,
How would you test a number to see if its a multiple of another number?
I want to test of, say, widget.x is a multiple of, say 100, or not.
Thanks!
Hi,
How would you test a number to see if its a multiple of another number?
I want to test of, say, widget.x is a multiple of, say 100, or not.
Thanks!
Use the modulo operator in your condition to test for the remainder after division:
If widget.x % 100 equals 0
Some examples:
512 % 100 == 12
400 % 100 == 0
10 % 100 == 10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.