int_to_hex/3—convert an integer value to a string containing its hexadecimal notation in a specified field width
The int_to_hex/3 primitive converts an integer value to a string containing its hexadecimal notation in a specified field width.
int_to_hex/3 arguments
Argument | Mode | Type | Description |
---|---|---|---|
$INTVAL | Input | INTEGER | Specifies the integer value to be converted to hexadecimal notation |
$FLDLEN | Input | INTEGER | Specifies the required resulting field width |
$STRVAL | Output | STRING | The hexadecimal notation of the integer returned as a string |
Use int_to_hex/3 to convert the integer value specified in the $INTVAL argument to a string containing its hexadecimal notation that is the same width as the field width specified by the $FLDLEN argument. The resulting hexadecimal notation string is returned in the $STRVAL argument. If the resulting notation is smaller than the specified field width, the notation is padded with 0 to the left of the notation until it is the specified width of the field.
int_to_hex/3 example