Truncates a number to the specified precision without rounding (truncation toward zero).
Same as input typeDiperbarui: 13 Jun 2026TRUNC(expression [, precision])Numeric value to truncate
Number of decimal digits (default: 0)
Default: 0
1 SELECT 2 value, 3 TRUNC(value) as truncated, 4 ROUND(value) as rounded, 5 FLOOR(value) as floored 6 FROM UNNEST([2.7, -2.7]) as value;
Comparison of TRUNC with ROUND and FLOOR.
| value | truncated | rounded | floored |
|---|---|---|---|
| 2.7 | 2 | 3 | 2 |
| -2.7 | -2 | -3 | -3 |
1 SELECT 2 price, 3 TRUNC(price, 2) as price_two_decimals 4 FROM `project.dataset.products`;
Truncates price to 2 decimal places without rounding.
Sudah paham TRUNC? Latih langsung di browser
Latihan interaktif, langsung di browser.