Titan



int2hex


This function converts a single integer value to a single hexstring value. The resulting string is length hexadecimal digits long.

For the purposes of this conversion, a hexstring shall be interpreted as a positive base 16 integer value. The rightmost hexadecimal digit is least significant, the leftmost hexadecimal digit is the most significant. The hexadecimal digits 0 ... F represent the decimal values 0 ... 15 respectively. If the conversion yields a value with fewer hexadecimal digits than specified in the length parameter, then the hexstring shall be padded on the left with zeros.


Related keyword:


int2hex(in integer value, in integer length) return hexstring


Example 1:

const hexstring c_entiere := int2hex(64,3);

The constant c_entiere will contain the hexadecimal string 040 because the converted integer number (64 -> 40) must be coded on 3 hexadecimal digits and therefore padded with a leading zero.