Truncates the input value to the specified number of digits / decimal places.

 

Usage

number (required) The number to be truncated

digits [optional] The number of decimal places to which to round. Defaults to 0.
If "digits" value is negative, the function will return an integer with that many least-significant digits zeroed (see example 4 below).

 

Examples

(1) Returns 5.24

Trunc(5.2463, 2)

(2) Returns 5.

Trunc(5.678)

(3) Truncates the value in each row of the input column to 3 decimal places. 

Trunc([Cost], 3)

Screen_Shot_2020-11-30_at_4.59.13_PM.png

(4) Rounds the input number down and replaces its last 2 digits with 0s. A negative "digits" value returns an integer with that many least-significant digits zeroed.

Trunc([Cost], -2)

Screen_Shot_2020-11-30_at_5.00.54_PM.png

 

See Also

Round - Rounds the input number to the specified number of digits.

Int - Rounds the input number down to the largest integer of equal or lesser value.

RoundDown - Rounds a number down to the specified number of digits.

RoundUp - Rounds a number up to the specified number of digits.