Apache OpenOffice (AOO) Bugzilla – Issue 128518
Basic - Converting "+1" to a number
Last modified: 2022-06-23 15:19:31 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.