TRUNC (truncate a number)

<< Click to Display Table of Contents >>

TRUNC (truncate a number)

Syntax:

TRUNC(Number [, n])

Description:

This returns the given number truncated to n digits after the decimal point.

n is the desired number of decimal places.

If n is omitted, Number is truncated to an integer.

If n is a negative value, Number is truncated to the left of the decimal point (see last example).

Example:

TRUNC(5.779) returns 5

TRUNC(5.779, 2) returns 5.77

TRUNC(1234, -2) returns 1200

Additional info:

To obtain the decimal places, use the DECIMALS function.

See also:

ROUNDDOWN, ROUNDUP, DECIMALS, ROUND