BAHTTEXT Function (Calligra Sheets)
Use BAHTTEXT in Calligra Sheets to spell amounts in Thai baht and satang, with exact text examples, rounding behavior and input-conversion cautions.
Verification status: 19 selected formulas were executed through the Calligra Sheets 25.04.2 calculation engine library in the C locale. Exact typed outputs and source-derived checks are documented; 26.08.2 was source-checked only. No GUI-cell or import claim. How formula examples are checked
Quick answer: =BAHTTEXT(0) returns "ศูนย์บาทถ้วน" in the tested engine.
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 the limitations described here; no retirement established.
- Scope: Desktop Sheets with the Text module. Formulas use English names and semicolon separators.
- Checked: October 14, 2026: selected 25.04.2 engine-library formulas and independent reconstructions; 26.08.2 source only. The test locale was C. No GUI-cell, import or other-locale execution is claimed.
What BAHTTEXT returns
BAHTTEXT returns a text spelling of an amount in Thai baht and satang. It does not exchange currencies. The implementation accepts a fractional number, rounds its absolute value to satang, builds Thai digit groups, and restores a negative prefix. Although the versioned help labels its parameter as an integer, the implementation and examples here include fractions. Official function reference.
Syntax and arguments
=BAHTTEXT(number)
number is the amount to spell. Exactly one argument is required. Keep the numeric amount in a separate cell if you also need arithmetic: the returned words are text. Registration and implementation.
Reproducible engine examples
Quotation marks identify text results; error tokens without quotes are actual errors. Numeric results are rounded here to twelve decimal places. The reconstruction column applies independent decimal arithmetic or the inspected character/parser rules, rather than claiming another application test.
| Formula | Engine result | Independently reconstructed expectation |
|---|---|---|
=BAHTTEXT(0) |
"ศูนย์บาทถ้วน" |
"ศูนย์บาทถ้วน" |
=BAHTTEXT(1) |
"หนึ่งบาทถ้วน" |
"หนึ่งบาทถ้วน" |
=BAHTTEXT(11) |
"สิบเอ็ดบาทถ้วน" |
"สิบเอ็ดบาทถ้วน" |
=BAHTTEXT(21) |
"ยี่สิบเอ็ดบาทถ้วน" |
"ยี่สิบเอ็ดบาทถ้วน" |
=BAHTTEXT(101) |
"หนึ่งร้อยหนึ่งบาทถ้วน" |
"หนึ่งร้อยหนึ่งบาทถ้วน" |
=BAHTTEXT(1000000) |
"หนึ่งล้านบาทถ้วน" |
"หนึ่งล้านบาทถ้วน" |
=BAHTTEXT(1234.56) |
"หนึ่งพันสองร้อยสามสิบสี่บาทห้าสิบหกสตางค์" |
"หนึ่งพันสองร้อยสามสิบสี่บาทห้าสิบหกสตางค์" |
=BAHTTEXT(-1.25) |
"ลบหนึ่งบาทยี่สิบห้าสตางค์" |
"ลบหนึ่งบาทยี่สิบห้าสตางค์" |
Practical worksheet
For an invoice amount, enter 1234.56 in A2 and put =BAHTTEXT(A2) in B2. The expected text is หนึ่งพันสองร้อยสามสิบสี่บาทห้าสิบหกสตางค์. Keep A2 as the numeric source for totals and B2 as the written-amount field. A value below one baht may contain only satang words: the tested =BAHTTEXT(0.5) returns ห้าสิบสตางค์, without a zero-baht prefix.
Advanced interpretation and checks
The cent-rounding step is floor(abs(number)*100+0.5). Thus the tested 1.999 becomes two whole baht, สองบาทถ้วน. The minus flag is recorded before rounding: −0.001 becomes ลบศูนย์บาทถ้วน, a negative-zero wording. If your document should show zero instead, normalize the numeric amount under your own stated rounding policy before spelling it.
The stored Thai lexemes and group rules determine the exact output. For example, the tested 101 is หนึ่งร้อยหนึ่งบาทถ้วน; do not silently substitute a different linguistic spelling when checking the formula. The matching test below compares the full 1234.56 string, including every Thai character.
=EXACT(BAHTTEXT(1234.56);"หนึ่งพันสองร้อยสามสิบสี่บาทห้าสิบหกสตางค์")
The executed result was TRUE.
Boundaries and troubleshooting
Validate imported amounts before calling BAHTTEXT. In these engine tests, numeric text was parsed, TRUE became one, and nonnumeric text or the expression 1/0 became the zero-baht wording. Those last two results can hide a bad source value; a successful text result does not prove the input was a valid amount. Missing or extra arguments produced #VALUE!.
The code uses binary64 arithmetic and a cent-rounding step. The examples establish their listed values, not unrestricted precision for very large amounts or every decimal tie. The Thai strings are formula outputs; their suitability for a particular invoice or legal document is a separate editorial requirement.
| Formula | Engine result |
|---|---|
=BAHTTEXT(.5) |
"ห้าสิบสตางค์" |
=BAHTTEXT(.01) |
"หนึ่งสตางค์" |
=BAHTTEXT(1.999) |
"สองบาทถ้วน" |
=BAHTTEXT(-.001) |
"ลบศูนย์บาทถ้วน" |
=BAHTTEXT("1234.56") |
"หนึ่งพันสองร้อยสามสิบสี่บาทห้าสิบหกสตางค์" |
=BAHTTEXT("abc") |
"ศูนย์บาทถ้วน" |
=BAHTTEXT(TRUE()) |
"หนึ่งบาทถ้วน" |
=BAHTTEXT(1/0) |
"ศูนย์บาทถ้วน" |
=BAHTTEXT() |
#VALUE! |
=BAHTTEXT(1;2) |
#VALUE! |
Official evidence and precision scope
The complete selected callback is byte-identical in the inspected 25.04.2 and 26.08.2 sources. The text module has an unrelated SEARCH change; whole-file equality is not claimed. The locale helpers are byte-identical. These comparisons do not establish execution of the later release.