To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=78144


User bmarcelly changed the following:

                What    |Old value                 |New value
================================================================================
                      CC|''                        |'bmarcelly'
--------------------------------------------------------------------------------




------- Additional comments from [EMAIL PROTECTED] Wed Jun  6 18:59:19 +0000 
2007 -------
IMHO this is not a bug.
It is due to the Basic interpretation of your string.
The result depends on the decimal separator used (set by Tools > Options > 
Linguistic 
parameters > Linguistic Environment).
If it is not a period then the string may be interpreted as a date. You have 
the same 
kind of problem when inserting a number in a Calc cell.

Try this macro:
dim v as string
v = "2.00"   ' <--- set your value
print CDbl(v)
print CDate(v)

Results (found with version 2.2.0 on Win XP):
Linguistic  String    CDbl(v)   CDate(v)
US-en       "2.00"     2.0       Error
US-en       "21.59"   21.59      Error
FR-fr       "2.00"    36557     01/02/2000 (Febr 1st, 2000)  
FR-fr       "21.59"   Error      Error
DE-de       "2.00"    36557     01/02/2000 (Febr 1st, 2000) 
DE-de       "21.59"   2159       Error

You may find different results with other Linguistic environment.

If you want to convert a string with period as decimal separator, use:
print CDbl(Val(v))
This code is independent of  Linguistic environment.



---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to