TRUNC()

SyntaxTRUNC(number,num_digits)

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

Arguments

  • number (required) The number you want to truncate.

  • num_digits (optional) A number indicating the precision of the truncation. The default value for num_digits is 0. You can specify positive and negative values for the num_digits argument.

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:

  • =TRUNC(234.4692354,2) returns 234.46.

  • =TRUNC(234.4692354,-1) returns 230.

  • =TRUNC(9.3) returns 9.

  • =TRUNC(-9.3) returns -9.

  • =TRUNC(18.628,2) returns 18.62.

See Also

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

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.187.165