Contingut
Índex 🔎︎

# TRUNC function

Truncates a number while keeping a specified number of decimal digits.

This function is equivalent to the ROUNDDOWN function.

El mètode d'arrodoniment que utilitza aquesta funció es coneix com a arrodoniment cap a zero. El nombre resultant sempre serà més petit que, o igual a, l'original.

#### Sintaxi

TRUNC(Number [; Count])

Number: The number to be truncated.

Count: Optional parameter that defines the number of decimal places to be kept. The default value is 0 (zero).

Use negative values for Count to round the integer part of the original Number. For example, -1 will round down the first integer number before the decimal separator, -2 will round down the two integer numbers before the decimal separator, and so forth.

#### Exemple

=TRUNC(21.89) returns 21. Note that this example uses the default value for Count which is 0.

=TRUNC(103.37,1) returns 103.3.

=TRUNC(0.664,2) returns 0.66.

=TRUNC(214.2,-1) returns 210. Note the negative value for Count, which causes the first integer value before the decimal separator to be rounded towards zero.

Temes relacionats

ROUNDDOWN function

Funcions matemàtiques