TRUNCNUM Function [Numeric]

Truncates a number at a specified number of places after the decimal point.

Syntax

TRUNCNUMnumeric-expression, integer-expression )

Parameters

Parameter

Description

numeric-expression

The number to be truncated.

integer-expression

A positive integer specifies the number of significant digits to the right of the decimal point at which to round. A negative expression specifies the number of significant digits to the left of the decimal point at which to round.

Returns

NUMERIC

Examples

The following statement returns the value 600:

SELECT TRUNCNUM( 655, -2 ) FROM iq_dummy

The following statement: returns the value 655.340:

SELECT TRUNCNUM( 655.348, 2 ) FROM iq_dummy

Usage

This function is the same as TRUNCATE, but does not cause keyword conflicts.

You can use combinations of ROUND, FLOOR, and CEILING to provide similar functionality.

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Not supported by Adaptive Server Enterprise.

Related reference
ROUND Function [Numeric]