TRUNC |
TRUNC (n [,m]) |
Truncates a number to a specific number of decimal places.
Parameters
n
Specifies a number to be truncated.
m
Specifies the number of decimal places to preserve in the result. Truncating all decimal places is the default. Negative values for m result in digits being truncated to the left of the decimal point.
Example
SQL> SELECT TRUNC(99.99), TRUNC(99.99,1), TRUNC(99.99,-1) 2 FROM dual; TRUNC(99.99) TRUNC(99.99,1) TRUNC(99.99,-1) ------------ -------------- --------------- 99 99.9 90
|
Get Oracle SQL: the Essential Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.