RE: [flexcoders] Re: Number(011) = 9 ????

2005-10-05 Thread Abdul Qabiz
: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: 1. The octal literal 011 is compiled as the decimal Number 9. 2. It is converted at runtime to the string 9, because parseInt expects

RE: [flexcoders] Re: Number(011) = 9 ????

2005-10-05 Thread Philippe Maegerman
trag 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: 1. The octal literal 011 is compiled as the decimal Number 9. 2. It

RE: [flexcoders] Re: Number(011) = 9 ????

2005-10-05 Thread Blake Kadatz
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); }

RE: [flexcoders] Re: Number(011) = 9 ????

2005-10-04 Thread Gordon Smith
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 and first argument is an expression, so