Issue 54049

Summary: Basic : String to Currency conversion is incorrect
Product: General Reporter: bmarcelly <marcelly.bernard>
Component: scriptingAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: alex.thurgood, issues, maison.godard
Version: OOO 2.0 Beta2Keywords: oooqa
Target Milestone: AOO Later   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description bmarcelly 2005-08-31 17:43:38 UTC
In a document create this macro and run it:

Sub bugStr2Curr
dim c as currency, t as string
t = "200,0000"
c = t
msgbox(t & " = " & c)
End Sub 

On my 1.9.113 Win XP I get :
200,0000 = 6333188975989.7600 

Another user on Linux OOo2Beta2RC gets this :
200,0000 = 0.0001

Other values for t give other strange values. Sometimes even without the comma.
Conclusion : the implicit conversion from string to currency is bugged.
Comment 1 alex.thurgood 2005-09-01 13:08:45 UTC
I can confirm this behaviour. The interpreter seems to take the values to be a
US_en string. This means that other locale representations of currency strings
return incorrect results.

Setting oooqa keyword.

alex
Comment 2 alex.thurgood 2005-09-01 13:10:47 UTC
.
Comment 3 noel.power 2005-09-02 08:50:05 UTC
reassign to ab
Comment 4 ab 2005-09-02 12:22:08 UTC
Started
Comment 5 squenson 2008-07-16 20:55:33 UTC
There is an overflow for all values above (2^31 - 1)/10000 which seems to
indicate that the problem is linked to a wrong casting of a 32-bit variable into
a 64-bit variable.
Comment 6 Marcus 2017-05-20 11:29:32 UTC
Reset assigne to the default "issues@openoffice.apache.org".