https://bugs.documentfoundation.org/show_bug.cgi?id=98778
Bug ID: 98778
Summary: String to numeric conversion fails when number is
formatted as scientific notation
Product: LibreOffice
Version: 4.4.7.2 release
Hardware: All
OS: Mac OS X (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
When assigning a string variable containing a number formatted as scientific
notation, to a double variable, the conversion fails and zero is assigned. See
example code below:
Sub Main
dim d as double
dim s as string
s="1.0E-5"
d=s
msgbox "Value of d is: "+str(d)
End Sub
However, if s is set equal to "0.00001" then it works correctly. A workaround
is to use the val() function, but this often requires numerous changes to
legacy code that worked fine in OpenOffice Basic.
I haven't checked any versions earlier than the one listed here (4.4.7.2). So,
I don't know how far back this problem existed.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs