The leading "0" makes flash think you're trying to use an octal (base 8) number. You can use parseInt(numberStr, 10) to force using base 10.
~Trout http://www.amongtrout.com On 1/24/06, quinrou . <[EMAIL PROTECTED]> wrote: > > Hi all, > > I am having some really strange things with the Number casll > > here are some tests I've been running and some unexpecting things > happened. > > var str:String = "0023"; > trace(str); // output 0023 - this correct and expected > > > var numb:Number = Number(str) > trace(numb); // output 19 - this incorrect and unexpected - was expecting > either 0023 or 23 > > var numb2:Number = Number("23") > trace(numb2); // output 23 - this correct and expected > > var numb3:Number = Number("00"+"23") > trace(numb3); // output 19 - this incorrect and unexpected - was expecting > either 0023 or 23 > > var numb4:Number = Number("11"+"23") > trace(numb4); // output 1123 - this correct and expected > > is there a bug with the class number and the use of 0 ? how am I supposed > to > get 0023 or 23 out of "0023" (string) without cleaning the string and > looking for the 0's. > > thanks > > Seb > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders