---
schema_version: "1"
id: 0f10185326033b40a1bc6873441dfde95546cd8e87062759de1d2086a9cd4df4
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_saql/guides/reference/bi-saql-functions-math-trunc.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-trunc.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: afc448c4f5ca513187136ba1c7d210ba0ef8e52e2840519e32726fb83f13c1fa
products:
  - Analytics SAQL 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 -1e308 \<= n \<= 1e308. _m_ can be an integer value between -15 and 15 inclusive. This function can only be used in a `foreach` statement.

## Example

```nolang
q = foreach q generate trunc(Price, 2) as Price;

```
