Issue 54049 - Basic : String to Currency conversion is incorrect
Summary: Basic : String to Currency conversion is incorrect
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: OOO 2.0 Beta2
Hardware: All All
: P3 Trivial (vote)
Target Milestone: AOO Later
Assignee: AOO issues mailing list
QA Contact:
Keywords: oooqa
Depends on:
Reported: 2005-08-31 17:43 UTC by bmarcelly
Modified: 2017-05-20 11:29 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
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.

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