You can use computations to convert decimal numbers to hexadecimal, and vice versa. For example, if a user enters a decimal number in an interview, you can use a computation to merge the answer in the assembled document as a hexadecimal number.
To convert decimal numbers to hexadecimal, the computation first determines how many digits are in the hexadecimal number by comparing the original decimal number to various powers of 16. (A decimal number less than 16 (161) requires only one digit; greater than 16, but less than 256 (162) requires two digits, and so on.) Once the number of digits is determined, the hexadecimal number is added to the result, one digit at a time. At the end of the computation, if the result is still empty, the computation result is "0".
To convert hexadecimal numbers to decimal, the computation examines each digit in the hexadecimal number, one at a time, and multiplies it by the corresponding power of 16. Each of these results are added to return the sum, which is the number converted to a decimal (base 10) number.