Bug 919020 - Converting String to Double
Summary: Converting String to Double
Alias: None
Product: Fedora
Classification: Fedora
Component: libreoffice
Version: 17
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Eike Rathke
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2013-03-07 12:20 UTC by gbhansen.dk
Modified: 2013-05-03 02:02 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-04-26 00:55:42 UTC
Type: Bug

Attachments (Terms of Use)

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

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

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 

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- 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.

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- for f17-candidate.

Comment 12 Fedora Update System 2013-04-23 10:05:15 UTC
libreoffice- has been submitted as an update for Fedora 17.

Comment 13 Fedora Update System 2013-04-23 16:59:14 UTC
libreoffice- has been submitted as an update for Fedora 18.

Comment 14 Fedora Update System 2013-04-24 01:26:02 UTC
Package libreoffice-
* 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-'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 15 Fedora Update System 2013-04-26 00:55:44 UTC
libreoffice- 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- has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.