Number to Hexadecimal String
- Updated2023-02-17
- 2 minute(s) read
Number to Hexadecimal String
Converts a numeric value to a string that shows the number's hexadecimal format. The digits A through F always appear in uppercase in the output string.

Inputs/Outputs

number
A number to be converted into a string.
This input can also be any data type that contains only numbers, such as an array of numbers or a cluster of numbers. If this input is floating-point, this node rounds it to a 64-bit integer before conversion.

width
A number specifying how many characters to use to express number as a string.
If width is less than the number of characters required, this node uses exactly as many characters as needed. If width is greater than the number of characters required, this node adds a space on the left side of the output string for each additional character.
Default value: No value — Exactly as many characters as are needed to represent the number, with no extra padding.

hex integer string
number represented as a hexadecimal string.
Examples
number | width | hex integer string | Comments |
---|---|---|---|
3 | 4 | 0003 | If width is larger than needed, zeros are added on the left. |
42 | 3 | 02A | — |
-4.2 | 3 | FFFFFFFC | -4.2 is rounded up to -4 in 64-bit integer format. width is too small to represent the hex version of a negative number, so the field width is extended. |