toString(radix);Sample:
radix Specifies the numeric base (from 2 to 36) to use for the number-to-string conversion.
package
{
import flash.display.Sprite;
public class Sample_AS extends Sprite
{
public function Sample_AS()
{
var num:int = 241;
trace(num.toString(2)); // Binary
trace(num.toString(8)); // Octal
trace(num.toString(16)); // Hexadecimal
}
}
}
No comments:
Post a Comment