TRUNC

Removes the fractional part of a number by truncating it to a specified number of decimal places. Unlike rounding, TRUNC simply cuts off digits without rounding up or down.

Parameter List

Syntax
TRUNC(number
[num_digits]
)
number

The number to truncate. For example: 123.456, -87.92, or A1.

[optional] num_digits

The number of decimal places to keep:

  • Positive number - Truncate to that many decimal places

  • 0 (default) - Truncate to integer (no decimal places)

  • Negative number - Truncate to the left of decimal point

More details

TRUNC removes digits by cutting them off rather than rounding. For positive num_digits, it truncates to that many decimal places. For negative num_digits, it truncates to the left of the decimal point (e.g., -1 truncates to the nearest 10, -2 to the nearest 100). When num_digits is 0 or omitted, it removes all decimal places, returning an integer.

Examples

TRUNC(123.456) returns 123, truncating 123.456 to integer (removes .456).
🍪

We use cookies to enhance your user experience and analyze website performance. You can revoke consent anytime. Learn more.