-
number to string conversion
var z:Number = 011;
trace(z);
why does this return 9 in actionscript 2.0?
is there a way to change the String "011" to the number 11?
-
Senior Member
In many C-like languages, including actionscript, when an integer is specified with a leading zero, it is assumed to be in the octal (base 8) number system. 11 in octal is the same as 9 in decimal.
Remove the leading zero.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|