Getting numbers after decimal in Javascript
<p>I have a color picker, and the hue values returned are numbers between zero and 1.
To create variations on the hue, I add .2 for 20%, .8 for 80% etc.</p>

<p>How can I keep the numbers going around the circle, so that when the number goes above 1, it subtracts the 1.  How can I make this number into this number:
1.73540012511 ---> .7354</p>

<p>I tried using a "cents" javascript, (http://www.irt.org/script/6.htm) but this returned values greater than 1:
<a href="http://jsfiddle.net/Se9Dn/" rel="nofollow">http://jsfiddle.net/Se9Dn/</a></p>

<p>I can't use Math.min, because I want 1.2 to become .2 (not to have the colors all become red when they hit 1).  </p>

<p>Thanks. :)</p>

<hr>

<p><strong>Edit:</strong>
Confirming solution, with rounding added. Assuming you have an HSL color (Hue, Saturation, Luminosity) returned from Farbtastic and want to adjust Hue mathematically:</p>

<pre><code>hslcolor  = (.73802938, .59832908, .948987);
colorStep = .2;
newcolor[0] = Math.round ( ((1*colorStep +hslcolor[0])%1)*10000 ) /10000;
</code></pre>

<p>Watch out those parenthesis are very tricky in there.</p>
