%TRUNCATE

Truncate a numeric expression

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
whole_num = %TRUNCATE(expression)

Return value

whole_num

%TRUNCATE returns the whole-number portion of expression.

The result has the same numeric data type as expression. If expression is implied-decimal data type, the result has the same fractional precision as expression, and the fractional precision is filled with zeros. (n)

Arguments

expression

A numeric expression to be truncated. (n)

Discussion

The difference between %TRUNC and %TRUNCATE is that with implied-decimal arguments, %TRUNC returns a result with no fractional precision and %TRUNCATE returns a result with the same fractional precision as expression.

Examples

The following intrinsic function returns the value 33.0.

%truncate(33.5)