NET/MASTER Network Control Language (NCL) Reference Manual

TRUNC
Built-in Functions
4–88 106126 Tandem Computers Incorporated
TRUNC The TRUNC built-in function truncates a number to a specific number of decimal
places.
TRUNC(
number
[,
n
] )
number
specifies the number to be truncated. The integer part of the number is not
affected.
n
specifies the number of decimal places to preserve. It must be a positive whole
number. If this operand is not specified, 0 (zero) is assumed and all decimal places
are truncated. If
n
is greater than the number of decimal places in
number
, the
number is returned unchanged.
Examples
In the following example, no value for
n
is specified, so the number -12.45 is truncated
to -12:
&A = -12.45
&RESULT = TRUNC(&A)
In the following example, the number 12.45069214 is truncated to four places after the
decimal point. The output string is 12.4506:
&A = 12.45069214
&B = 4
&RESULT = TRUNC(&A,&B)