Bug 919020

Summary: Converting String to Double
Product: [Fedora] Fedora Reporter: gbhansen.dk
Component: libreofficeAssignee: Eike Rathke <erack>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: caolanm, dtardon, erack, extras-orphan, ltinkl, mstahl, notting, sbergman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-26 00:55:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description gbhansen.dk 2013-03-07 12:20:44 UTC
Description of problem:


Version-Release number of selected component (if applicable):3.2.0 and 3.4.0


How reproducible:Converting String to fx. Double, Single etc not functioning

Example:
Dim A As String
Dim B As Double
A = "222.22"
B = Cdbl(A)
MsgBox(B)


Steps to Reproduce:
1.Open openoffice Calc 
  choose admin. macro

2.Enter macro as example
3.Save and run
  
Actual results: 222


Expected results:222.22


Additional info:The function Val is also not functioning.
When installing openoffice 3.4.0 under windows the convertion functions are working perfectly.
So it is in the linux as the same result is performing in libreoffice on an Ubuntu 12.04 system.

System Fedora 13 
Kernel: 2.6.34.9-69.fc13.i686 

System Fedora 16
Kernel: 3.6.11-4.fc16.i686

Comment 1 Eike Rathke 2013-03-07 14:29:46 UTC
In what locale are you running the application? I can't exactly reproduce this, but having tried with libreoffice-3.5.7.2-9.fc17 I experienced similar weird behavior in other locales with different separators. It works fine in an en-US locale. It may be that the underlying BASIC function uses a localized system library function to parse the string, which could also explain that it doesn't occur on Windows as there these functions are not localized.

Note however that F16 is EOL, I changed the Version field to F17.

Comment 2 gbhansen.dk 2013-03-08 10:59:01 UTC
The system works under DA-dk (Danish)
I have tried to change locale to us-en and now the functions are working.
In the description of Openoffice and Libreoffice is stated that the programs are using underlying system locale settings, which apparently is incorrect.
It is rather inconvienient to have to change locale when running written macros.
 
PROBLEM PARTLY SOLVED

Comment 3 Eike Rathke 2013-03-19 17:21:02 UTC
CDbl() and CSng() are mainly used to scan user input so it makes sense to have them localized, but the current implementation is wrong.

Comment 4 Eike Rathke 2013-03-19 17:35:37 UTC
Btw, if you want non-localized number scanning, use Val() instead that uses '.' as decimal separator and ',' as group separator.

Comment 6 gbhansen.dk 2013-03-20 10:43:49 UTC
The case with converting failure is also a problem when using us-en locale in an localized system ex. da-dk.
Then you cannot use the spreadsheet where the result from converting are going as the decimal and group separator is wrong.

Comment 8 Caolan McNamara 2013-04-03 07:50:48 UTC
are we backporting this back to 3.5.X F-17, or punting it until F-18 ?

Comment 9 Eike Rathke 2013-04-04 09:56:06 UTC
It should be possible to backport it.

Comment 11 Eike Rathke 2013-04-22 18:30:40 UTC
Modified for libreoffice-3.5.7.2-12.fc17 for f17-candidate.

Comment 12 Fedora Update System 2013-04-23 10:05:15 UTC
libreoffice-3.5.7.2-12.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/libreoffice-3.5.7.2-12.fc17

Comment 13 Fedora Update System 2013-04-23 16:59:14 UTC
libreoffice-3.6.6.2-5.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/libreoffice-3.6.6.2-5.fc18

Comment 14 Fedora Update System 2013-04-24 01:26:02 UTC
Package libreoffice-3.6.6.2-5.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libreoffice-3.6.6.2-5.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-6396/libreoffice-3.6.6.2-5.fc18
then log in and leave karma (feedback).

Comment 15 Fedora Update System 2013-04-26 00:55:44 UTC
libreoffice-3.5.7.2-12.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2013-05-03 02:02:03 UTC
libreoffice-3.6.6.2-5.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.