https://bz.apache.org/ooo/show_bug.cgi?id=128518
Issue ID: 128518
Issue Type: DEFECT
Summary: Basic - Converting "+1" to a number
Product: App Dev
Version: 4.1.12
Hardware: PC
OS: Windows, all
Status: CONFIRMED
Severity: Minor
Priority: P5 (lowest)
Component: scripting
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
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.
--
You are receiving this mail because:
You are the assignee for the issue.