NET/MASTER Network Control Language (NCL) Reference Manual
D2C
Built-in Functions
4–32 106126 Tandem Computers Incorporated
D2C The D2C built-in function converts a decimal number to an ASCII character string.
D2C(
wholenumber
[,
n
] )
wholenumber
specifies the number to be converted. If you specify a
wholenumber
of 0 (zero),
NCL returns a null string.
n
specifies an optional length (0 (zero) through 4) for the resulting output string.
The binary representation of
wholenumber
is sign-extended or truncated to fit
within the length
n
.
Considerations
If
n
is specified,
wholenumber
may be positive or negative. If
n
is not specified,
wholenumber
must be positive. The output string is sign-extended or truncated
as required.
The binary value returned always has its least significant bit as the low-order bit of
the byte with the highest storage address.
See also C2D and D2X. The C2D built-in function converts a character string to a
decimal number. The D2X built-in function converts a decimal number to its
hexadecimal equivalent.
Examples
In the following example, NCL converts the number 4276803 to return the string
“ABC”. This is because the decimal value 4276803 is equivalent to the ASCII
representation of the letters “ABC”:
&A = 4276803
&RESULT = D2C(&A)
In the following example, NCL converts the number 65 to the letter “A”:
SAY D2C(65)