Now on to my problem.....
I've been using a for loop to speed up repetitive tasks and it seems to work great, till now.
for (count=0;count<30;count+=2.4) //2.4 doesn't work consistently//
The results I get start out correct then go wrong.
FireFox (3.6.16)____________________Results with IE 8____________________Results with Opera
If I use...
for (count=0;count<30;count+=1) //1, 2, 3, etc.. works fine//
for (count=0;count<30;count+=1.5) //1.5 works fine//
It counts like it should.
So why is it when I use "2.4" it doesn't count properly?
And why does it produce different results in different browsers?
You could use this hacky addition to sort the rounding out:
That worked for me. Thank You.
It still doesn't make sense why it doesn't work without the fix and why different browsers give different results.
Again, thank you.
Another suggestion I got was to use....
Which works as well, just has a permanent float which is not a problem (for this project).
You're right, it doesn't make sense.
Here's an article that can help to explain why.
Why I Love ECMAScript 4: Real Decimals
Thanks for the help. Still kinda Greek to me, but it helped.
Nice link. Will be interesting to see if the rounding or 1DP solutions above remain quicker than the proposed decimal types.