DEC2OCT Function (Calligra Sheets)
Convert decimal integers into octal text with Calligra DEC2OCT, including optional padding, round trips and digit-validation boundaries.
Verification status: Selected formulas were executed through the Calligra Sheets 25.04.2 calculation engine library. No workbook-import or GUI-cell result is claimed; 26.08.2 was source-checked only. How formula examples are checked
Quick answer: =DEC2OCT(64;4) gives 0100 in the tested Calligra calculation engine. Successful DEC2OCT results are text strings.
Availability and version history
- Introduced: First release not established; the name is present in Calligra 2.4.0 source.
- Supported in: Calligra Sheets 26.08.2, with no retirement established.
- Scope: Desktop Sheets with the Engineering function module. Examples use English semicolon-separated formulas.
- Checked: October 14, 2026. Formulas were executed through the official 25.04.2 engine library, with source and independent arithmetic checks. This is not GUI-cell or workbook-import evidence; 26.08.2 was source-checked, not executed.
What the result represents
DEC2OCT returns a base-8 text representation. Octal uses only 0 through 7; after 7 comes 10, which represents decimal 8. For example, decimal 128 becomes octal 200 because 2×8²=128. Function help.
Syntax and arguments
=DEC2OCT(number[;places])
Number is required and places is an optional minimum length. The function registration accepts one or two arguments. Use nonnegative integers and an integer width chosen for the destination field. The wrapper checks decimal digits before passing the number to the conversion helper. Brackets mark optional arguments and are not entered in a formula. Registration, implementation and versioned help.
Reproducible engine examples
These outputs were obtained through Calligra 25.04.2’s Formula parser and calculation library. The ordinary conversions also match independent positional arithmetic. Backticks preserve literal leading zeroes; they are not part of the entered result.
| Formula | Engine result |
|---|---|
=DEC2OCT(0) |
0 |
=DEC2OCT(7) |
7 |
=DEC2OCT(8) |
10 |
=DEC2OCT(15) |
17 |
=DEC2OCT(64;4) |
0100 |
=DEC2OCT(128) |
200 |
=DEC2OCT(511;2) |
777 |
=DEC2OCT(512) |
1000 |
Practical worksheet
For a four-character octal field representing decimal 64, put 64 in A2 and 4 in B2. =DEC2OCT(A2;B2) gives 0100. The octal digits 100 represent 1×8², not decimal one hundred. Keep the original decimal value and the encoded string in clearly labeled columns.
Advanced checks and field widths
The recorded check =OCT2DEC(DEC2OCT(128;4)) returns 128. The intermediate octal text is padded, but the decoded number has no leading-zero presentation. For a three-digit octal field, the maximum nonnegative value is 7×64+7×8+7=511. Decimal 512 instead needs octal 1000.
Places is only a minimum. DEC2OCT(511;2) still gives 777. If a downstream format permits only two octal characters, that is a capacity error to handle before exporting, not a reason to slice away the first digit.
Input boundaries and error cases
Negative input, a fractional value such as 8.5 and invalid text produced #VALUE! in the tested engine. Numeric text “64” was accepted. The observed negative width simply left the natural output, and 3.9 was converted to a three-character width. These coercions should not replace deliberate integer validation.
The following engine results show the specific inputs tested. They do not establish every text-format, locale or import rule.
| Formula | Engine result |
|---|---|
=DEC2OCT(-1) |
#VALUE! |
=DEC2OCT(8.5) |
#VALUE! |
=DEC2OCT("64") |
100 |
=DEC2OCT(8;-1) |
10 |
=DEC2OCT("abc") |
#VALUE! |
=DEC2OCT(8;3.9) |
010 |
Range and verification limits
The shared text-conversion helper narrows the numeric input to a C++ int before formatting it. These small integer examples do not establish safe conversion of arbitrary large identifiers. Validate the intended value and field width before export; do not assume another spreadsheet’s numeric limits or signed convention.
The Engineering module and conversion helper are byte-identical in the inspected 25.04.2 and 26.08.2 source files. That supports the source comparison, but does not turn these engine tests into execution of a newer binary or confirmation of its UI/import behavior.