NET/MASTER Network Control Language (NCL) Reference Manual

D2X
Built-in Functions
106126 Tandem Computers Incorporated 4–33
D2X The D2X built-in function converts a decimal number to a hexadecimal string.
D2X(
wholenumber
[,
n
] )
wholenumber
specifies the number to be converted. If you specify a
wholenumber
of 0 (zero),
NCL returns a null string.
n
specifies the length (0 (zero) through 8) of the resulting output string. The
hexadecimal representation of the number is sign-extended or truncated to fit
within the specified length
n
.
Considerations
If
n
is supplied,
wholenumber
may be positive or negative. If
n
is not supplied,
wholenumber
must be positive.
See also C2D, D2C, and X2D. The C2D built-in function converts a character string
to a decimal value. The D2C built-in function converts a decimal number to an
ASCII character string. The X2D built-in function converts a hexadecimal string to
a decimal number.
Examples
In the following example, NCL converts 11 to the output string “0B”:
&A = 11
&RESULT = D2X(&A)
In the following example, NCL converts 259 to the output string “03”, truncating it
because a length of 2 is specified:
&A = 259
&B = 2
&RESULT = D2X(&A,&B)