Javascript precision increment/decrement number
<p>I am working with values between and including 0 and 1 with 2 decimal points.</p>

<p>I am trying to increment from 0 to 1 in steps of 0.01 but am encountering issues:</p>

<p>The following is in a function that recursively calls itself.</p>

<pre><code>if ($Y.drawChallengeTextAlpha.toFixed(1) &lt; 1)
 $Y.drawChallengeTextAlpha += 0.01;
</code></pre>

<p>I never get past 0.95.</p>

<p><strong>EDIT</strong></p>

<p>I ended up with the following:</p>

<pre><code>// $Y.drawChallengeTextAlpha is an integer from 0 to 100
if ($Y.drawChallengeTextAlpha &lt; 100)
  $Y.drawChallengeTextAlpha += 1;  // May not always be 1
</code></pre>

<p>I then get my precise value with ($Y.drawChallengeTextAlpha / 100)</p>
