Issue 128518

Summary: Basic - Converting "+1" to a number
Product: App Dev Reporter: Czesław Wolański <czeslaw.wolanski>
Component: scriptingAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Minor    
Priority: P5 (lowest) CC: mseidel
Version: 4.1.12   
Target Milestone: ---   
Hardware: PC   
OS: Windows, all   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description Czesław Wolański 2022-06-23 15:14:30 UTC
Topic "CINT("+1") returns 0" on the English forum
https://forum.openoffice.org/en/forum/viewtopic.php?t=107921


Let's juxtapose relevant functions for the "+1" argument:
---> CInt() and CLng() return 0
---> CDec() returns 1
---> CSng() and CDbl create error message:

         "Inadmissible value or data type.
          Data type mismatch."

In case of implicit conversion:

 dim v as Integer REM  Integer | Long | Single | Double
 v = "+1"

the result is always 0

Besides isNumeric("+1") returns False
( see Issue 92057 - BASIC-Function isnumeric )


In VBA Excel each of the functions: CInt, CLng, CDec, CSng, CDbl
returns 1. That also happens in Basic in LibreOffice.

OpenOffice either returns an unexpected value or throws an error.
It should return 1.