WebSphere Message Broker, Version 8.0.0.7 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

TRUNCATE function

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

Syntax

Read syntax diagramSkip visual syntax diagram
>>-TRUNCATE--(--source_number--,--precision--)-----------------><

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.

Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:47:12


Reference topicReference topic | Version 8.0.0.7 | ak05400_