T
Tuxedo
Tom Cole wrote:
[...]
With the small addition of Math.floor, the following returns the desired
and unfractioned list of values in this example:
value = 1.0
while (value >= 0.04){
value = (Math.floor(value * 100) - 4) / 100
document.write(value +'<br>')
}
writes:
0.96
0.92
0.88
0.84
0.8
0.76
0.72
0.68
0.64
0.6
0.56
0.52
0.48
0.44
0.4
0.36
0.32
0.28
0.24
0.2
0.16
0.12
0.08
0.04
0
[...]
I don't know if this is the perfect solution but have you tried using
something like value = ((value * 100) - 4) / 100 ?
With the small addition of Math.floor, the following returns the desired
and unfractioned list of values in this example:
value = 1.0
while (value >= 0.04){
value = (Math.floor(value * 100) - 4) / 100
document.write(value +'<br>')
}
writes:
0.96
0.92
0.88
0.84
0.8
0.76
0.72
0.68
0.64
0.6
0.56
0.52
0.48
0.44
0.4
0.36
0.32
0.28
0.24
0.2
0.16
0.12
0.08
0.04
0