2011/6/6 Regina Henschel <rb.henschel@t-online.de>:
Hi Johnny,
Johnny Rosenberg schrieb:
CDbl returns an integer when the argument is a text string.
LibreOffice 3.4.0
OOO340m1 (Build:12)
OpenOffice.org 3.2.1
OOO320m19 (Build:9505)
ooo-build 3.2.1.4, Ubuntu package 1:3.2.1-7ubuntu1.1
Ubuntu 10.10
REM ***** BASIC *****
Option Explicit
Sub Main
Print CDbl("123.45")
' This gives an error message since my locale is Swedish (Sweden) →
decimal separator=comma.
End Sub
Help: the number must be entered as normal text ("123.5") using the default
number format of your operating system.
Yes, I know, which is ”123,5” in my case (Swedish standard is a decimal comma).
REM ***** BASIC *****
Option Explicit
Sub Main
Print CDbl("123,45")
' Prints 123, the decimals are gone.
End Sub
Is this a bug?
No, see help text.
The Help text says nothing about CDbl removing decimals
(CDbl("123,45") → 123 when it should be 123,45, right?.
Are there other ways to convert from text to a numerical value?
Try Val function.
Ooops, yes, you are right! Seems like my brain just doesn't work
today… Maybe it's because it was a very long time now since I wrote
any macros…
Still, even if I don't need CDbl, it doesn't seem to me to give the
expected results.
Kind regards
Regina
--
Unsubscribe instructions: E-mail to users+help@libreoffice.org
In case of problems unsubscribing, write to
postmaster@documentfoundation.org
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/www/users/
All messages sent to this list will be publicly archived and cannot be
deleted
Kind regards
Johnny Rosenberg
ジョニー・ローゼンバーグ
--
Unsubscribe instructions: E-mail to users+help@libreoffice.org
In case of problems unsubscribing, write to postmaster@documentfoundation.org
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/www/users/
All messages sent to this list will be publicly archived and cannot be deleted
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.