Export (0) Print
Expand All

TRUNC Function

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Truncates a number to an integer by removing the decimal, or fractional, part of the number.

TRUNC(<number>,<num_digits>)

Term

Definition

number

The number you want to truncate.

num_digits

A number specifying the precision of the truncation; if omitted, 0 (zero)

A whole number.

TRUNC and INT are similar in that both return integers. TRUNC removes the fractional part of the number. INT rounds numbers down to the nearest integer based on the value of the fractional part of the number. INT and TRUNC are different only when using negative numbers: TRUNC(-4.3) returns -4, but INT(-4.3) returns -5 because -5 is the smaller number.

The following formula returns 3, the integer part of pi.

=TRUNC(PI())

The following formula returns -8, the integer part of -8.9.

=TRUNC(-8.9)
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2015 Microsoft