---
schema_version: "1"
id: 18db95a20350a5375ca8ed7bb9c59efc7e6f3b80a7edacd0538a46c8b69c8186
title: trunc({n}[,{m}])
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_sql/guides/bi-sql-math-trunc.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-trunc.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4c929a5ac50aa0a0c432653b8c9c0582828dc7e45ecd1f32bfd90eab57547063
products:
  - SQL for Analytics Developer Guide
  - analytics
---

# trunc({n}[,{m}])

Returns the value of the numeric expression _n_ truncated to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ truncated to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ truncated to the integer place. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. _m_ can be an integer value between -15 and 15 inclusive.

`trunc({n}[,{m}])` takes the following syntax.

```nolang
SELECT trunc(N[,M]) as AliasName
FROM dataset;
```

## Example

This example returns 47.385 truncated to the second decimal place.

```nolang
SELECT trunc(47.385, 2) as truncExample FROM Superstore
LIMIT 1;
```

| truncExample |
| ------------ |
| 47.38        |
