Name
TRUNC
Synopsis
The TRUNC function truncates the first argument to the number of decimal places specified by the second argument. The specification for the TRUNC function is:
FUNCTION TRUNC (nNUMBER, [decimal_placesNUMBER]) RETURN NUMBER;
The decimal_places argument is optional and
defaults to 0, which means that n will be
truncated to zero decimal places, a whole number. The value of
decimal_ places can be less than zero. A
negative value for this argument directs TRUNC to truncate or
zero-out digits to the left of the decimal point rather than to the
right. Here are some examples:
TRUNC (153.46) --> 153 TRUNC (153.46, 1) --> 153.4 TRUNC (-2003.16, -1) --> -2000
For a comparison of ROUND with several other numeric functions, see Table 9-7 and Figure 9-5 earlier in Section 9.3.1 .
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access