TRUNC Function in ONLYOFFICE Spreadsheet Editor: Syntax, Examples and Limits
Discard digits without rounding: remove the fractional part by default or retain a selected number of decimal places.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
TRUNC function in ONLYOFFICE Spreadsheet Editor
Quick answer
Discard digits without rounding: remove the fractional part by default or retain a selected number of decimal places. Use the documented signature =TRUNC(number, [num_digits]). Numbers shown below are expected results from independent Decimal arithmetic and vendor documentation, not observed outputs from an installed ONLYOFFICE application.
What TRUNC does and when you should choose it
Create controlled, non-rounded numeric extracts, compare truncated and floored signed values, or compute complete groups for explicitly nonnegative inputs. It changes the numeric value rather than only its display format.
The documented function truncates to the requested precision; at omitted num_digits it keeps the integer portion. Its expected difference from INT is especially visible for negatives: TRUNC(-8.999) → -8 versus INT(-8.999) → -9. The short ONLYOFFICE help confirms syntax/default but does not publish a comprehensive negative-place edge-case table; these are calculated test expectations.
ONLYOFFICE TRUNC function reference establishes the function’s published signature and basic purpose. The vendor’s function-selection guide describes entering formulas via the Formula tab or manually after an equals sign.
Official syntax, argument order and defaults
=TRUNC(number, [num_digits])
| Parameter | Required? | Meaning / precision note | Example |
|---|---|---|---|
number |
Required | A number, expression or numeric cell reference to truncate. | A2 |
num_digits |
Optional | Number of decimal places retained. If omitted, ONLYOFFICE documents a default of 0. Negative values are plausible left-of-decimal cases but the short reference does not spell out full behaviour. |
2 or omit |
The function name is typed literally, but number and num_digits are placeholders for actual arguments, references or expressions. Square brackets in the documentation signature denote an optional parameter; they are not literal characters to type. In this guide, every explicit num_digits is an integer so a fractional-precision coercion rule need not be assumed.
Precision guide: for two-argument rounding/truncation, num_digits = 2 denotes hundredths, 1 tenths, 0 whole units, and -2 hundreds (the negative-digit cases are documented as test expectations requiring native confirmation). For INT there is only one documented argument; no digits parameter exists.
Version, platform and locale applicability
- Primary product scope: ONLYOFFICE Docs Spreadsheet Editor, English unversioned current function help and Insert Functions index, checked 2026-10-11 UTC. The help article documents a function, not a first-available version, so
first_supported_version = UNKNOWN. - Server/web edition: documented at the official help level; not executed in a known installed Docs server build. The Docs changelog contains a dated 9.4.0 entry (2026-05-20), but that does not prove this particular function was introduced then.
- Desktop Editors (Windows/macOS/Linux): the Formula tab guide shows a desktop and online interface, and the separate Desktop changelog records Desktop 9.4.0 (2026-05-19). No version-specific TRUNC execution was run on a desktop build, and function compatibility is not inferred from the release number alone.
- Mobile and integrations: availability and evaluation results across particular builds have not been validated; a Docs web documentation page is not a complete mobile or edition/version matrix.
- English examples and separators: all formulas below begin with
=and use comma argument separators, as illustrated in the English insert function guide. Advanced Settings permits selecting the Formula Language and region. Verify local function names, separators and decimal conventions on the target installation; copying English examples unchanged is not guaranteed to work in every locale.
Practice sheet: exact input data
Create an empty sheet. Enter the numbers below in column A as numeric values, not quoted text. The leading minus sign is part of the negative input. These are intentionally simple decimal inputs so that a calculation can be independently checked without a screenshot.
| Cell | Enter this numeric value | Why it matters |
|---|---|---|
| A2 | 12.341 |
Positive decimals |
| A3 | -12.341 |
Negative decimals |
| A4 | 1492.6 |
Thousands-place case |
| A5 | -1492.6 |
Negative thousands-place case |
| A6 | 8.999 |
Just below next integer |
| A7 | -8.999 |
Negative fraction near an integer |
| A8 | 0.125 |
Small positive fraction |
| A9 | -0.125 |
Small negative fraction |
| A10 | 0 |
Zero boundary |
| A11 | 15 |
Already exact integer |
Step-by-step use
- In
A1typeInput. Enter the ten numeric values from the table inA2:A11. InB1typeTRUNC expected check. - Copy each formula from the following table into the indicated cell in column B. Alternatively, insert the function through the Formula tab → Function search and choose
TRUNC; check the argument order displayed. - Compare each value with its expected result below, checking whether the negative sign and
num_digitsare correct. Results are not screenshots or claims of a native app run. - Change one original input (for example, change
A2to12.300) and note whether the corresponding result changes. RestoreA2 = 12.341before checking other formulas. - If a result differs, record the version, product edition, formula language, number format, actual formula and displayed result. Do not silently replace the independently calculated result with a guessed application output.
Worked formulas and expected results
| Output cell | Enter exactly | Expected numerical result | Why |
|---|---|---|---|
| B2 | =TRUNC(A2,2) |
12.34 | Two decimal places |
| B3 | =TRUNC(A3,2) |
-12.34 | Negative retains magnitude sign |
| B4 | =TRUNC(A4,-2) |
1400 | Truncate to hundreds |
| B5 | =TRUNC(A5,-2) |
-1400 | Negative hundreds-place |
| B6 | =TRUNC(A6) |
8 | Omitted optional digits → zero |
| B7 | =TRUNC(A7) |
-8 | Negative with default digits |
| B8 | =TRUNC(A8,1) |
0.1 | Small positive fraction |
| B9 | =TRUNC(A9,1) |
-0.1 | Small negative fraction |
| B10 | =TRUNC(A10) |
0 | Zero |
| B11 | =TRUNC(A11) |
15 | Exact integer |
What to notice: Each row demonstrates a different sign, precision or boundary case. A table cell showing 12.3 numerically does not have to display a trailing zero such as 12.30 unless its cell number format requests it. Displayed decimals and the number used by a formula are separate concepts.
Advanced applications, with reproducible calculations
Truncate monetary-looking measurements without pretending this is a tax rule
=TRUNC(27.689,2)
=TRUNC(-27.689,2)
Expected: 27.68 and -27.68. This deliberately removes the extra digit rather than choosing the closest cent. It should not be used for legally mandated invoice, payroll, sales-tax or interest calculations without the actual governing rounding method.
Do negative values behave like INT?
=TRUNC(-4.3)
=INT(-4.3)
Expected: -4 and -5. For negative measurements, simple integer-part extraction and floor-based grouping answer different questions. If you need mathematical binning into nonoverlapping intervals, the INT version is generally the intended one.
Truncate large values at the hundreds place
=TRUNC(1492.6,-2)
=TRUNC(-1492.6,-2)
Expected: 1400 and -1400, respectively. ONLYOFFICE’s brief TRUNC description does not explicitly discuss negative num_digits; this is an independently calculated Excel-style compatibility check requiring native edition verification.
Count fully filled packs for a nonnegative quantity
With 53 items in D2 and a positive capacity 12 in E2:
=TRUNC(D2/E2)
Expected: 4 whole packs, leaving 5 items. This is not how many packs are needed to ship all items; for that business question, ROUNDUP(53/12,0) expects 5. The positive-domain assumption matters.
Check yourself: one more test
Enter =TRUNC(-8.999) in an empty cell. The independently expected result is -8. Reason: With the optional argument absent, truncation drops the negative fractional portion toward zero. The actual output on your installed build must be recorded separately; it has not been observed in this research run.
Errors, edge cases and common mistakes
- Negative values: TRUNC ≠ INT.
TRUNC(-8.999)expects-8, whereasINT(-8.999)expects-9. - Optional digit precision defaults to zero:
=TRUNC(A2)does not mean “preserve every decimal”; it removes all fractional digits per official help. - Do not confuse number formatting with truncation: formatting changes how many digits appear; TRUNC changes the numerical result used by subsequent calculations.
- A sign-sensitive convention: the expected behaviour with negative
num_digitsis from independent arithmetic and Excel comparison; verify in installed ONLYOFFICE before claiming a certified implementation detail. - Fractional
num_digitsnot specified in this short help: use whole numbers as the precision argument until you have a reproducible native test. - Text, blanks, and array coercion: the linked function reference does not enumerate exact native errors or coercion rules; test and report build-specific results rather than guessing codes.
- Irreversible loss of precision: once a rounded or truncated value is used downstream, the removed digits cannot be recovered by displaying more decimals.
Troubleshooting checklist
- A formula appears verbatim instead of calculating: ensure the cell contains a formula beginning with
=rather than a quoted or text-formatted string; use the documented Formula-tab insertion method. - An unrecognized function name or argument warning: search for
TRUNCin the actual installed version’s Insert Function dialog. Verify the formula language and spelling; do not assume the web reference’s function name is the local display name. - An unexpected negative answer: compare the sign-sensitive explanation and the row for
A3,A5,A7, orA9. Decide whether your business rule means toward zero, away from zero, or toward negative infinity. - An unexpected precision: check whether the precision was
2,0or-2, whether the formula selected the intended input cell, and whether the cell’s number format is hiding digits. - Errors from blank/text values: first reproduce with a literal numeric argument. Only then test the imported value; the published short function reference does not establish all error codes or implicit coercion rules. Do not label an unobserved outcome as an ONLYOFFICE bug.
- Excel import gives a different value: save a minimal workbook with one example, record both application versions, platform and language, and ask for a native side-by-side result. Matching English signatures alone are not sufficient evidence of identical evaluation.
Differences from Excel and other spreadsheet editors
Microsoft Excel documents TRUNC(number,[num_digits]) with default zero and explains its contrast with INT on negative numbers. ONLYOFFICE documents the identical English argument layout and zero default, while not providing the same detailed comparison examples. That is a documented syntax alignment with outstanding native-behaviour verification, not a blanket cross-platform guarantee. Excel TRUNC.
Specific documented distinction: INT is mathematically a floor, while TRUNC removes digits toward zero; ROUNDUP and ROUNDDOWN select directional rounding at a requested place. Although the names appear in other spreadsheet products, no equivalent names, arguments, conversions or error results are assumed for a particular Google Sheets, LibreOffice, Apple Numbers or localized installation without separate current evidence.
Related function references and internal-link status
- INT official reference — related operation; not a verified published Spreadsheet-Tutorials.com internal route.
- ROUNDDOWN official reference — related operation; not a verified published Spreadsheet-Tutorials.com internal route.
- ROUNDUP official reference — related operation; not a verified published Spreadsheet-Tutorials.com internal route.
- ROUND official reference — related operation; not a verified published Spreadsheet-Tutorials.com internal route.
Official reference and verification
- ONLYOFFICE Spreadsheet Editor — function documentation
- vendor’s function-selection guide
- Docs changelog
- Formula tab guide
- Desktop changelog
- Advanced Settings
- INT official reference
Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in ONLYOFFICE Spreadsheet Editor.
- No genuine ONLYOFFICE Spreadsheet Editor screenshots are included; this guide does not use mock application images.