Re: [Flashcoders] using parseInt() and Math.floor() doesn't return the same value

2006-10-19 Thread slangeberg
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

[Flashcoders] using parseInt() and Math.floor() doesn't return the same value

2006-10-19 Thread Martin Tremblay
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?