TRUNC

Description

TRUNC truncates the given number to an integer.

Syntax

TRUNC ( number [, precision] )

 

Parameter

Description

number

Any value.

precision

The number of decimal places allowed in the truncated number. Omitting this argument assumes a precision of 0. With negative numbers zeros replace the corresponding number of digits to the left of the decimal point.

Remarks

TRUNC removes the fractional part of a number to the specified precision without rounding the number.

Example

This function returns 123.45:

TRUNC(123.456, 2)

This function returns 9800:

TRUNC(9899.435, -2)

 Note:

If an Invalid formula syntax warning appears, check whether the comma is set as the list separator in your regional settings on the Windows Control Panel. If a different character is set as the list separator, use this character in the above examples in place of the comma. (Windows XP: Access the Windows Control Panel and select Regional and Language Options. On the Regional Options tab page, click Customize. On the Numbers tab page, check which character is the default list separator on your computer. Use this character in the above examples instead of the comma.

Also, see

CEILING

FLOOR

INT

MOD

ROUND