https://bugs.documentfoundation.org/show_bug.cgi?id=97983

            Bug ID: 97983
           Summary: cInt function treats , as decimal
           Product: LibreOffice
           Version: 5.0.4.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 122772
  --> https://bugs.documentfoundation.org/attachment.cgi?id=122772&action=edit
Demonstration Writer document with macro

The cInt function treats string "1,234" as being 1.  This is true on 3
different operating systems on 2 different PCs, all of which are defined as
being in the EN GB locale using '.' as the decimal point in the language
settings (I have double-checked this).

I have tested this on:

ubuntu 14.04 64 bit, Version: 5.1.1.1 Build ID: 1:5.1.1~rc1-0ubuntu1~trusty1
CPU Threads: 8; OS Version: Linux 4.2; UI Render: default; Locale: en-GB
(en_GB.UTF-8) (from ubuntu pre-release PPA)

Windows 7 (on same PC) Version 5.0.4.2 (from Libreoffice website)

xubuntu 15.04 (a 64 bit laptop), Version 5.0.5.2 Build ID: 1.5.0.5-rc2-0ubuntu2
Locale en:GB (en GB.UTF-8) (from ubuntu release PPA)

I don't how far back this issue goes.  It's easy to work-around, just use
format to remove the ','s, but could fool people for a long time if in the
middle of a complex algorithm.

I attach a Writer document demonstrating this. Press the button to see what
"1,234" turns into.  The macro is in 'Module1', 'Main', and just says:

Sub Main
    Dim sText as String
    Dim iIntText as Integer
    sText = "1,234"
    iIntText = cInt (sText)
    MsgBox "1,234 becomes" & iIntText
End Sub

I originally found this using Basic in Base.  I thought I'd demonstrate it in
Writer just to show it was nothing to do with Base.

Or am I being really stupid?

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

Reply via email to