A measured TRUNC gallery: toward-zero chopping, optional num_digits and the TRUNC-vs-ROUNDDOWN-vs-INT distinction — every assertion engine-verified. Live, free.
Chops digits toward zero without rounding. num_digits is optional, unlike ROUNDDOWN.
TRUNC truncates — it chops off digits toward zero without rounding. The second argument is optional (defaults to 0). Every row measured live in HyperFormula. Click any row to load it.
| Expression | Result | Why |
|---|---|---|
| =TRUNC(3.7) | 3 | Chop the decimal, toward zero |
| =TRUNC(-3.7) | -3 | Negative also toward zero (not floor) |
| =TRUNC(3.14159,2) | 3.14 | Keep 2 decimals, chop the rest |
| =TRUNC(-3.14159,2) | -3.14 | Negative keeps 2 decimals |
| =TRUNC(1234,-2) | 1200 | -2 chops to the hundred below |
| =TRUNC(7) | 7 | Integer unchanged |
| =TRUNC(0.9) | 0 | Fraction dropped to 0 |
| =TRUNC(9.99,1) | 9.9 | Keep 1 decimal |
| Expression | Result | Why |
|---|---|---|
| =TRUNC(-3.7) | -3 | Toward zero |
| =ROUNDDOWN(-3.7,0) | -3 | Toward zero — identical |
| =INT(-3.7) | -4 in Excel | INT floors; this HF engine returns -3 |
| Expression | Result | Why |
|---|---|---|
| =TRUNC(3.14159,2) | 3.14 | Keep 2 decimals |
| =TRUNC(3.14159,1) | 3.1 | Keep 1 decimal |
| =TRUNC(1234,-2) | 1200 | -2 chops left of the decimal |
All presets are exact and engine-stable; the INT comparison notes a documented HyperFormula deviation.
10 failure patterns mined from actual user reports on Reddit, Stack Overflow and Super User — each with the authentic symptom, root cause, a fix, and a runnable formula. Not textbook theory.
TRUNC is universal across Excel, Google Sheets and LibreOffice Calc with identical toward-zero behaviour.
| Platform | Support | Notes | Gotcha |
|---|
TRUNC is one piece. The full course walks the toolkit end to end with live, measured examples.