DEC2OCT Function (OpenOffice Calc)
Encode decimal integers as octal in Apache OpenOffice, with signed limits, fractional-input conversion and padded text examples.
Verification status: Eight reference formulas and 8 diagnostic cases were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using XLSX import and GUI hard recalculation. Saved formula identities and typed results were checked. How formula examples are checked
Quick answer: =DEC2OCT(64) returned 100 in the tested Apache OpenOffice 4.1.16 build.
Availability and version history
- Introduced: First release not established; documented by OpenOffice.org 3.3.
- Supported in: Apache OpenOffice 4.1.16; this identifies a verified release, not a final supported version.
- Scope: Desktop Calc with its Analysis add-in, English function names and semicolon-separated formulas.
- Checked: October 14, 2026. Eight reference formulas and the listed diagnostics were recalculated after XLSX import in 4.1.16 on Linux x86-64, Build 9816. Source and independent reference calculations were also checked.
What DEC2OCT returns
DEC2OCT returns an octal text representation of a decimal input under Calc’s signed thirty-bit output convention. Negative values are represented by ten octal digits rather than a printed minus sign. Release entry.
Syntax and arguments
=DEC2OCT(Number [; Places])
Number is converted to the integer argument passed to this add-in and must fall from −536870912 through 536870911 after conversion. Optional Places must convert to an integer from 1 through 10. It pads nonnegative outputs; negative outputs occupy ten octal digits. Fractional Number behavior is illustrated by the native diagnostics rather than inferred from a different product.
Reproducible examples
The native column records the saved 4.1.16 results. Text-returning conversion strings are retained exactly, including leading zeroes and uppercase hexadecimal letters. OCT2DEC, IMREAL and IMAGINARY return numeric values. These integer and quarter-unit references agree exactly with the saved results; errors are checked by display rather than interpreted from a numeric zero cache.
| Formula | Native 4.1.16 result | Independent reference |
|---|---|---|
=DEC2OCT(0) |
0 |
0 |
=DEC2OCT(1) |
1 |
1 |
=DEC2OCT(8) |
10 |
10 |
=DEC2OCT(64) |
100 |
100 |
=DEC2OCT(511) |
777 |
777 |
=DEC2OCT(-1) |
7777777777 |
7777777777 |
=DEC2OCT(-512) |
7777777000 |
7777777000 |
=DEC2OCT(536870911) |
3777777777 |
3777777777 |
Practical worksheet
=DEC2OCT(64) returns 100, because 64=1×8². =DEC2OCT(8;4) returns 0010. These are text encodings, not a request to change the number format of an ordinary decimal cell.
The maximum positive input 536870911 returns 3777777777. The negative input −1 returns 7777777777. A downstream decoder must use the same thirty-bit signed convention to recover the intended values.
Advanced interpretation and checks
For a negative integer n, the output digits encode 2^30+n. At n=−512 this is 7777777000. The leading octal digit contains the sign bit only when the representation has the required ten-digit width.
The tested fractional cases 8.9 and −8.9 show the add-in’s integer argument conversion. State that conversion explicitly rather than calling DEC2OCT an exact fractional-base converter. To retain a fraction, a different representation and an independently specified fractional conversion method are needed.
An empty referenced cell can become numeric zero. Keep completeness checks separate from conversion, particularly when a missing measurement must not look like a valid zero code.
Boundaries and troubleshooting
The two adjacent out-of-range integers are tested below and return errors. A positive output longer than Places is rejected rather than truncated. Negative results stay ten digits even with a valid smaller Places value. The examples establish ordinary integer conversion and boundary values, not a guarantee about every extreme numeric input or locale.
These additional formulas were recalculated through the same import path. H5 is a deliberately empty cell where referenced. Error displays are retained as errors, even when an ODS numeric attribute stores zero.
| Formula | Observed result or error |
|---|---|
=DEC2OCT(8;4) |
0010 |
=DEC2OCT(64;2) |
Err:502 |
=DEC2OCT(-1;1) |
7777777777 |
=DEC2OCT(536870912) |
Err:502 |
=DEC2OCT(-536870913) |
Err:502 |
=DEC2OCT(8.9) |
10 |
=DEC2OCT(-8.9) |
7777777770 |
=DEC2OCT(H5) |
0 |
Other spreadsheet implementations
The DEC2OCT guide for Gnumeric documents that product’s own syntax and tested behavior. A shared function name does not guarantee the same argument conversion, text parsing, branch or precision rules.
Official evidence and checking scope
- Function-specific release entry
- Conversion or strict complex parser
- Signed positional decoder
- Width conversion
The saved ODS retained every tested formula identity. A deliberately stale SUM cache changed from 999999 to 3, and an uncached SUM returned 7 after hard recalculation. Native evidence covers the eight reference formulas and listed diagnostics only. Other explanatory compositions are independent mathematical checks; other releases, locales and extreme-value behavior were not established by this run.