# TRUNC

> TRUNC function in StackQL: the integer part of a number, rounding towards zero and discarding any fraction.

Source: https://stackql.io/language-spec/functions/math/trunc

Returns the integer part of a number by rounding towards zero, stripping away any fractional component.

See also:  
[[`SELECT`]](/language-spec/select) 

* * * 

## Syntax

```sql
SELECT TRUNC(numeric_expression) FROM <multipartIdentifier>;
```

## Arguments

__*numeric_expression*__  
An expression of the exact numeric or approximate numeric data type category.

## Return Value(s)
Returns a numeric value truncated to its integer component.

* * *

## Examples

### Truncate the number of days since creation of Google Cloud Storage buckets to two decimal places

```sql
SELECT name, timeCreated,
TRUNC(julianday('now') - julianday(timeCreated)) as days_since
FROM google.storage.buckets WHERE project = 'stackql';
```
