There is a function for convert an integer to Hex in delphi .
function IntToHex(Value: Integer; Digits: Integer): string;
Description
IntToHex converts a number into a string containing the number's hexadecimal (base 16) representation. Value is the number to convert. Digits indicates the minimum number of hexadecimal digits to return.It the Digits is less than the actual length of hexadecimal it return full length of that hexadecimal.
Example :
MyHex := inttohex(255,2);
the result
MyHex is FF.
MyHex := inttohex(255,6);
the result
MyHex is 0000FF.
MyHex := inttohex(12345,1);
the result
MyHex is 3039.
No comments:
Post a Comment