WebSphere Message Brokers
File: ak05400_
Writer: Bill Oppenheimer

Reference topic

This build: July 31, 2007 21:32:05

TRUNCATE function

The TRUNCATE numeric function truncates a supplied decimal number a specified number of places.

Syntax

If precision is positive, the result of the TRUNCATE function is source_number truncated to precision places right of the decimal point. If precision is negative, the result is source_number truncated to the absolute value of precision places to the left of the decimal point.

source_number can be any built-in numeric data type. precision must evaluate to an INTEGER. The result is of the same data type as source_number. If any parameter is NULL, the result is NULL.

For example:
TRUNCATE(27.75, 2)
returns 27.75
TRUNCATE(27.75, 1)
returns 27.7
TRUNCATE(27.75, 0)
returns 27.0
TRUNCATE(27.75, -1)
returns 20.0

If possible, the scale is changed to the given value. If the result cannot be represented within the given scale, it is INF.

Related concepts
ESQL overview
Related tasks
Developing ESQL
Related reference
Syntax diagrams: available types
ESQL numeric functions
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:32:05

ak05400_ This topic's URL is: