Один из первых запросов в гугл:
function IntToHex(IntValue, Digits: integer): string;
var
i, j: integer;
s: string;
begin
s := '';
if IntValue > 0 then
begin
i := IntValue;
while i>0 do
begin
j := i mod 16;
if (j<10) then
s := Chr(Ord('0') + j) + s;
else
s := Chr(Ord('A') + (j - 10)) + s;
i := i div 16;
end;
end;
if Digits < 1 then Digits := 1;
i := Digits - Length(s);
while i>0 do
begin
s := '0' + s;
i := i - 1;
end;
IntToHex := s;
end;