You might want to alter Abdul's function slightly if you expect more
than one leading zero:
function getDecimalNumber(numStr:String):Number
{
if(numStr.indexOf("0")== 0)
{
return getDecimalNumber(numStr.substr(1));
}
return Number(numStr);
}
Cheer
oogroups.com
[mailto:[EMAIL PROTECTED] Im> Auftrag von Gordon Smith>
Gesendet: Dienstag, 4. Oktober 2005 20:05> An:
flexcoders@yahoogroups.com> Betreff: RE: [flexcoders] Re: Number("011") =
9 > > If you do parseInt(011, 10), I'm pretty sure what
happens is this:>
chricht-
> Von: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Im
> Auftrag von Gordon Smith
> Gesendet: Dienstag, 4. Oktober 2005 20:05
> An: flexcoders@yahoogroups.com
> Betreff: RE: [flexcoders] Re: Number("011") = 9
>
> If you do parseInt(011, 10), I'
L PROTECTED] On Behalf Of Abdul
Qabiz
Sent: Tuesday, October 04, 2005 10:29 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Number("011") = 9
Hi,
What do you want to do?
Convert 011 to decimal 11
Or convert octal(11) to decimal(9)
parseInt(..) is a global function
aegerman
> Gesendet: Dienstag, 4. Oktober 2005 12:24
> An: flexcoders@yahoogroups.com
> Betreff: RE: [flexcoders] Re: Number("011") = 9
>
> If they are all octal numbers, you can use
> mx.controls.Alert.show("" + Number("011").toString(8));
>
&
If they are all octal numbers, you can
use
mx.controls.Alert.show("" + Number("011").toString(8));
Philippe
Maegerman
From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of
jamiebadmanSent: mardi 4 octobre 2005 11:34To:
flexcoders@yahoogroups.comSubject: [flexcoders]
6 matches
Mail list logo