Issue 86314 - Text parameter of function evaluates to 0
Summary: Text parameter of function evaluates to 0
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: editing (show other issues)
Version: OOo 2.3.1
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2008-02-21 15:19 UTC by kpalagin
Modified: 2023-11-17 13:16 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
illustrating file (7.29 KB, application/vnd.oasis.opendocument.spreadsheet)
2008-02-21 15:20 UTC, kpalagin
no flags Details
before (2.x-3.1.1) and after (3.2.0-) (104.20 KB, image/png)
2023-11-17 11:51 UTC, Czesław Wolański
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description kpalagin 2008-02-21 15:19:19 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.
Comment 1 kpalagin 2008-02-21 15:20:02 UTC
Created attachment 51632 [details]
illustrating file
Comment 2 kpalagin 2009-05-19 07:38:22 UTC
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.
Comment 3 Regina Henschel 2009-05-19 20:19:43 UTC
@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
Comment 4 Czesław Wolański 2023-11-17 11:48:51 UTC
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.
Comment 5 Czesław Wolański 2023-11-17 11:51:56 UTC
Created attachment 87202 [details]
before (2.x-3.1.1) and after (3.2.0-)
Comment 6 Keith N. McKenna 2023-11-17 13:12:34 UTC
Closed per comment 4
Comment 7 Keith N. McKenna 2023-11-17 13:13:39 UTC
Closed per comment 4