Revision: 52735
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at November 1, 2011 04:22 by adrianparr
Initial Code
function decimalToHex($decimal:int, $padding:int = 2):String { var hex:String = Number($decimal).toString(16); while (hex.length < $padding) { hex = "0" + hex; } return hex.toUpperCase(); } var decimal:int = 163; trace("decimal: " + decimal); var hex:String = decimalToHex(decimal, 4); trace("hex: " + hex); // OUTPUT // decimal: 163 // hex: 00A3
Initial URL
Initial Description
Initial Title
AS3 Decimal To Hex
Initial Tags
number
Initial Language
ActionScript 3