Uh, isn't Math.floor supposed to round down? [and Math.ceil() rounds up?]
If so, it's working as advertised here.
Scott
On 10/19/06, Martin Tremblay <[EMAIL PROTECTED]> wrote:
I'm wandering if we should continue to use Math.floor() and Math.ceil()
since they are unreliable.
Code:
var a = 2.9
I'm wandering if we should continue to use Math.floor() and Math.ceil()
since they are unreliable.
Code:
var a = 2.999;
trace(parseInt(a.toString()));
trace(Math.floor(a));
trace(a);
output:
3
2
3
Would using methods using parseInt to simulate Math.floor() and
Math.ceil() be safer?
2 matches
Mail list logo