ID EN
#Math

TRUNC

Excel Functions

Truncate a number to a given precision

Syntax

EXCEL
=TRUNC(number, [num_digits])

Arguments

Parameter Description
number The number to truncate.
num_digits [optional] The precision of the truncation (default is 0).

Return Value

A truncated number

Details

The TRUNC function returns a truncated number based on an (optional) number of digits. For example, TRUNC(4.9) will return 4, and TRUNC(-3.5) will return -3. The TRUNC function does no rounding, it simply truncates as specified. The TRUNC function takes two arguments: number and num_digits. Number is the numeric value to truncate. The num_digits argument is optional and specifies the place at which number should be truncated. Num_digits defaults to zero (0). By default, TRUNC will return the integer portion of a number: To control the place at which number is truncated, provide a value for num_digits. When num_digits is negative, the TRUNC function will replace the number at a given place with zero:

Examples

Examples

By default, TRUNC will return the integer portion of a number:

EXCEL
=TRUNC(4.9) // returns 4
=TRUNC(-3.5) // returns -3
Examples

To control the place at which number is truncated, provide a value for num_digits.

EXCEL
=TRUNC(3.141593) // returns 3
=TRUNC(3.141593,0) // returns 3
=TRUNC(3.141593,1) // returns 3.1
=TRUNC(3.141593,2) // returns 3.14
=TRUNC(3.141593,3) // returns 3.141
Examples

When num_digits is negative, the TRUNC function will replace the number at a given place with zero:

EXCEL
=TRUNC(999.99,0) // returns 999
=TRUNC(999.99,-1) // returns 990
=TRUNC(999.99,-2) // returns 900

See Also

INT TRUNC ROUND ROUNDDOWN ROUNDUP MROUND CEILING FLOOR