Convert an Integer into a hexadecimal string SysUtils unit
 function IntToHex ( DecimalValue : Integer; MinimumWidth : Integer ) : string;
The IntToHex function converts a DecimalValue integer into a hexadecimal format sting of at least MinimumWidth characters wide.
The resulting string has no prefix character.
Related commands
IntToStr Convert an integer into a string
StrToInt Convert an integer string into an Integer value
 Author links

 Buy Website Traffic at

 Buy Proxies at
 Download this web site as a Windows program.

Example code : Convert an integer to a hex format
  // Display 123 decimal in hex with minimal width
  ShowMessage('1234 decimal = '+IntToHex(1234, 1));

  // Display 123 decimal in hex with fixed width
  ShowMessage('1234 decimal = '+IntToHex(1234, 8));
Show full unit code
   1234 decimal = 4D2
   1234 decimal = 000004D2
Delphi Programming Neil Moffatt 2002 - 2018. All rights reserved.  |  Home Page