Math · truncation · Nov 2026

The TRUNC function,
measured & explained.

A measured TRUNC gallery: toward-zero chopping, optional num_digits and the TRUNC-vs-ROUNDDOWN-vs-INT distinction — every assertion engine-verified. Live, free.

D1
fx
=TRUNC(3.7)
0
measured gallery rows
0
sourced errors fixed
0
platforms checked
// 01 — Anatomy

How TRUNC works

Chops digits toward zero without rounding. num_digits is optional, unlike ROUNDDOWN.

=TRUNC(number, [num_digits])
numberThe value to chop toward zero.
num_digitsOptional (default 0): >0 keeps decimals, <0 chops left of the decimal.
.bool-moat td.res-text{color:var(--cyan);font-weight:700;font-family:var(--mono)}
// 02 — Chop toward zero

What TRUNC actually returns

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.

Truncation gallery — toward zero

ExpressionResultWhy
=TRUNC(3.7)3Chop the decimal, toward zero
=TRUNC(-3.7)-3Negative also toward zero (not floor)
=TRUNC(3.14159,2)3.14Keep 2 decimals, chop the rest
=TRUNC(-3.14159,2)-3.14Negative keeps 2 decimals
=TRUNC(1234,-2)1200-2 chops to the hundred below
=TRUNC(7)7Integer unchanged
=TRUNC(0.9)0Fraction dropped to 0
=TRUNC(9.99,1)9.9Keep 1 decimal

TRUNC vs ROUNDDOWN vs INT on -3.7 (the classic interview question)

ExpressionResultWhy
=TRUNC(-3.7)-3Toward zero
=ROUNDDOWN(-3.7,0)-3Toward zero — identical
=INT(-3.7)-4 in ExcelINT floors; this HF engine returns -3

TRUNC with num_digits

ExpressionResultWhy
=TRUNC(3.14159,2)3.14Keep 2 decimals
=TRUNC(3.14159,1)3.1Keep 1 decimal
=TRUNC(1234,-2)1200-2 chops left of the decimal
⚠ TRUNC and ROUNDDOWN are identical (both toward zero); TRUNC just makes num_digits optional. The real trap is INT: Excel INT(-3.7)=-4 (floor) but TRUNC(-3.7)=-3. This HyperFormula playground computes INT as -3, a documented deviation — TRUNC is reliable here.
Use TRUNC to chop without rounding: keep N decimals exactly, drop a fractional unit, or truncate toward zero. Unlike formatting, TRUNC changes the stored value.
// 03 — Try it live

Interactive TRUNC playground

All presets are exact and engine-stable; the INT comparison notes a documented HyperFormula deviation.

A1Sample data — click any cell to edit, the formula re-evaluates live
Result
—
✓ readyHyperFormula 3.5
// 04 — Error library

The real-world error library

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.

// 05 — Cross-platform

Where TRUNC works

TRUNC is universal across Excel, Google Sheets and LibreOffice Calc with identical toward-zero behaviour.

PlatformSupportNotesGotcha
✓ Supported full TRUNC◐ Partial works with caveatsCompiled from public docs · verify against your build
// Go deeper

Master truncation

TRUNC is one piece. The full course walks the toolkit end to end with live, measured examples.

  • TRUNC vs ROUNDDOWN vs INT on negatives
  • Optional num_digits and decimal chopping
  • Truncate without rounding
  • When chopping beats rounding
Free while in beta
Browse the function library

No account needed. Every page has a live playground.

// 07 — FAQ

Frequently asked