Apache OpenOffice (AOO) Bugzilla – Issue 86314
Text parameter of function evaluates to 0
Last modified: 2023-11-17 13:16:31 UTC
In attached "text-param.ods" please see cells B3:B6 - they contain =EXP(C3) =COS(C3) =LN(C3) =SIN(C3) and act as if C3 is equal to zero, when C3 contains text. This looks wrong. Competing spreadsheet produces #VALUE error. OTOH, =COS("jkh") produces Err:502, which is correct and expected.
Created attachment 51632 [details] illustrating file
Dear developers, since we are very strict when dealing with empty cell (it is not considered zero anymore), this issue shows our relaxed attitude for potentially serious problem. Please see if this issue is even valid. Regards, K. Palagin.
@kpalagin: The current way is an allowed behavior, see section 6.2.4 of the draft spec, especially the comment. http://www.oasis-open.org/committees/documents.php?wg_abbrev=office-formula
From a note in ODF spec: "OpenOffice.org 2 splits the difference: Inline Text is converted to a Number (like Excel), but references to Text are always considered 0 (even if they could be converted to a different number, and would be converted to a different number if in-line). Thus, in OOo 2, if B3 has the string value "7", B3+1 is 1, but "7"+1 and (B3&"")+1 are both 8." OOo 3.2.0 introduced a new approach: "While interpreting a formula expression, string content is now converted to numeric values if conversion is unambiguous, or a #VALUE! error is set if no unambiguous conversion is possible.(...)" See: - the 3.2.0 Release Notes http://www.openoffice.org/development/releases/3.2.0.html - Issue 5658 ("Spreadsheet thinks a number is a string (text)" - Calc Help topic "Converting Text to Numbers" The attached .png file demonstrates the difference. Issue fixed, can be closed.
Created attachment 87202 [details] before (2.x-3.1.1) and after (3.2.0-)
Closed per comment 4