So this code adds up by 0.001 on each loop, i have it set to only show me 3 numbers past the decimal but on the 10th loop for example when it reaches 0.01 i want it to only show 2 numbers past the decimal, i dont need it to show the 0.
var Num = 0.000
for(s = 1; s <= 15; s++){
Num = Num + 0.001
var NumX = Num.toFixed(3)
if(NumX % 10 == 0){
var NumX = Num.toFixed(2)
alert("working")
}
}
I tried dividing by 10 in the above code but i dont know how to divide decimals can someone show me how to get this code to work, thanks.