Truncates a number at a specified number of places after the decimal point.
{ TRUNCNUM | TRUNCATE }( numeric-expression, integer-expression )
numeric-expression The number to be truncated. This argument may be of type NUMERIC or DOUBLE.
integer-expression A positive integer specifies the number of significant digits to the right of the decimal point at which to round. A negative value specifies the number of significant digits to the left of the decimal point at which to round.
NUMERIC or DOUBLE
If any parameter is NULL, the result is NULL.
You should use the TRUNCNUM function, not the TRUNCATE function, when truncating numbers.
Use of the TRUNCATE function is not recommended because the word truncate is a keyword, and therefore requires you to either set the quoted_identifier option to OFF, or put quotes around the word TRUNCATE.
SQL/2008 Vendor extension.
The following statement returns the value 600.
SELECT TRUNCNUM( 655, -2 ); |
The following statement: returns the value 655.340.
SELECT TRUNCNUM( 655.348, 2 ); |
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |