Another way to tackle it as well is to split it and compare the 2nd element
of the split array.
var num:Number = 2.3;
var split:Array = String(num).split(.);
trace(3 == split[1]);
On 12/6/06, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Message: 21
Date: Wed, 6 Dec 2006 12:22:43 -0800
From:
: Flashcoders Digest, Vol 23, Issue 13
Another way to tackle it as well is to split it and compare the 2nd
element
of the split array.
var num:Number = 2.3;
var split:Array = String(num).split(.);
trace(3 == split[1]);
On 12/6/06, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Message: 21
Date: Wed, 6 Dec
Yup, there are all kinds of things you can do if you cast it as a
String.
As far as the rounding thing goes, you want it to round.
0.2999 is supposed to be 0.3
If you multiply 0.29 by 10, you get 2.9.
You round it you get 3.
You divide by 10 you get .3.
myNum = Math.round(myNum *
3 matches
Mail list logo