A simple but helpful function for int-to-hex conversion.
/** Convert an int to a hex.
@param val Integer value.
@return Returns the hexadecimal value as string.
@see isHexadecimalNumber:
@see intFromHex:
*/
+ (NSString *)hexFromInt:(NSInteger)val {
return [NSString stringWithFormat:@"0x%X", val];
}
Download the ready-for-use source file (.m) of Int to Hex number conversion
No comments:
Post a Comment