How can I check for a whole number in AS 3?
Example:
for (var i:int = 0; i < thumbs.length(); i++)
{
if((i / this.thumbsRow) === wholeNumber)
}
How can I check for a whole number in AS 3?
Example:
for (var i:int = 0; i < thumbs.length(); i++)
{
if((i / this.thumbsRow) === wholeNumber)
}
Try the modulo operator:
var isWhole:Boolean = foo % 1 == 0;
trace("Is whole number: " + isWhole);
Where 'foo' is the number you're checking. Modulo gives you the remainder of dividing the first number by the second number. For any whole number, there would be no remainder.