TRUNC()

SyntaxTRUNC(number,num_digits)

Definition. This function truncates the decimal places of a number and returns an integer.

Arguments

Background. The TRUNC() function removes the fractional part of a number up to the decimal places specified in num_digits. If num_digits is omitted, the number is truncated to the integer.

The TRUNC() and ROUND() functions return the same result. The difference between both functions is that specifying the number of digits to truncate is optional for TRUNC(), but for ROUND() it is required.

Example. A practical use for this function is the truncation of money amounts, for example, to two decimal places or to even amounts. Here are some more examples:

See Also

CEILING(), CEILING.PRECISE(), FLOOR(), FLOOR.PRECISE(), INT(), MOD(), ROUND()