> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Trunc

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

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

## Usage

```
Trunc(number, [digits])
```

**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)
```

![Screenshot showing an applied Trunc truncating the value of each row of the input column to 3 decimal places](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/17d977be89c097a3b57cbc1f39bbabb80022a7008735765943675d185ac215f0/assets/docs-images/153bbaa-c.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260725%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260725T033754Z&X-Amz-Expires=604800&X-Amz-Signature=4dcb390933ba0654e52328d18474cfbba394b03fecd61a4db39b7d57ef88c659&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

(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)
```

![Applied Trunc rounding the input down and replacing last two digits with zeroes](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/f8b5f31c92ba19c2ce858107fb6de9e56bb7581af026693093a876ccb8e22cde/assets/docs-images/1b3a2a2-d.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260725%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260725T033754Z&X-Amz-Expires=604800&X-Amz-Signature=6975f343d19f9fcdaeb6a67d6a4b622bb854a5725cc479857c1dc913a38f66ff&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)