Contact

BASE Function (Calligra Sheets)

Engineering Intermediate Calligra Sheets

Convert numbers to text in bases 2–36 with Calligra BASE, including default base 10, zero-padding and tested input-conversion cautions.

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: =BASE(255;16;4) gives 00FF in the tested Calligra calculation engine. Successful BASE 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

BASE returns a text representation in a selected radix. The digit alphabet is 0–9 and A–Z. It is useful for display codes and comparing the same small integer in several number systems; it does not encode the characters of a decimal string separately. Function help.

Syntax and arguments

=BASE(number[;base[;minLength]])

Only number is required in the registered implementation. Base defaults to 10; minLength defaults to 0. The help’s syntax calls the third argument “prec,” while its parameter description says MinLength. The evaluator uses it as minimum total output length, not a number of fractional digits. Supply an integer base from 2 through 36 and a nonnegative integer width deliberately. 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
=BASE(255;16;4) 00FF
=BASE(128;8) 200
=BASE(13;2;8) 00001101
=BASE(35;36) Z
=BASE(36;36) 10
=BASE(16;2;2) 10000
=BASE(255) 255
=BASE(0;16;4) 0000

Practical worksheet

For inventory ID 13, enter 13 in A2, 2 in B2 and 8 in C2. =BASE(A2;B2;C2) produces the text 00001101. The arithmetic check is 13=8+4+1. Preserve the original numeric ID in a separate column so arithmetic is not later performed on a string whose radix may be misunderstood.

Advanced checks and field widths

The recorded round trip =DECIMAL(BASE(255;16;4);16) returns numeric 255. Its inner text is 00FF, and 15×16+15=255. DECIMAL interprets that text using the stated base; converting back naturally discards the display padding.

Width is a minimum, not a truncation limit here. BASE(16;2;2) gives 10000 because five binary digits are needed. A fixed-width export should reject values that exceed its field capacity instead of removing significant digits.

Input boundaries and error cases

BASE has permissive input conversion: the engine test with the text “abc” produced “0”. Do not use it as a validator for imported IDs. A negative width is changed to 2 by this wrapper, while a fractional input is truncated in the shared helper. The observed negative integer −1 becomes the text −1 in both tested bases, rather than a ten-digit complement. These behaviors differ from the stricter digit-only DEC2 functions.

The following engine results show the specific inputs tested. They do not establish every text-format, locale or import rule.

Formula Engine result
=BASE(1;1) #VALUE!
=BASE(1;37) #VALUE!
=BASE(1;16;-1) 01
=BASE(31.9;16) 1F
=BASE("abc";16) 0
=BASE(-1;10) -1
=BASE(-1;16) -1
=BASE(8;2.9;4) 1000

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.