"For developers", "Server scripts", "Functions description", "Converting types", "IntToHex".
Convert an integer to hexadecimal number as a string.
function IntToHex(iValue: int64; iDigits: byte): string;
Parameter |
Type |
Value |
---|---|---|
iValue |
integer |
positive integer that you need to convert to hexadecimal. If you transferred a negative number, the module will be taken from it; |
iDigits |
byte |
final maximum length of the string with leading zeros after conversion. |
Text sring that corresponds to the transferred positive integer.
begin
mLogScript(IntToHex(255, 2), '255');
mLogScript(IntToHex(65535, 2), '65535');
mLogScript(IntToHex(43981, 2), '43981');
end.
[16:55:58] (Log "IntToHex"): [255] FF
[16:55:58] (Log "IntToHex"): [65535] FFFF
[16:55:58] (Log "IntToHex"): [43981] ABCD
[16:55:58] (Run "IntToHex"): Script operation time: 3 ms
[16:55:58] (Run "IntToHex"): Script done successfully.