static String hex(int dec) { String str = "0123456789ABCDEF"; int hex2 = dec % 16; int hex1 = (dec - hex2) / 16; return str.substring(hex1, hex1 + 1) + str.substring(hex2, hex2 + 1); }
タグ: