I work with values โโbetween 0 and 1 with 2 decimal points.
I am trying to increment from 0 to 1 in increments of 0.01, but run into problems:
In a function that calls itself recursively, the following.
if ($Y.drawChallengeTextAlpha.toFixed(1) < 1) $Y.drawChallengeTextAlpha += 0.01;
I never get minus 0.95.
EDIT
I got the following:
// $Y.drawChallengeTextAlpha is an integer from 0 to 100 if ($Y.drawChallengeTextAlpha < 100) $Y.drawChallengeTextAlpha += 1; // May not always be 1
Then I get the exact value using ($ Y.drawChallengeTextAlpha / 100)
source share