Issue 85646 - not correct result when macro write the single value to cell and after read the one
Summary: not correct result when macro write the single value to cell and after read t...
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: programming (show other issues)
Version: OOo 2.3.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-28 16:27 UTC by mindauga
Modified: 2013-01-29 21:39 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mindauga 2008-01-28 16:27:23 UTC
Running next macro I get not correct result (see comments in macro):

Sub test
	dim value as single

'must be single - with double the problem dissapears

	sheet=thiscomponent.sheets(0)
	value = 12.51	

'value - any number with decimal part except *****.0 and *****.5
'(for example 12.0 and 12.5 are not valid)

	print value

'I get 12.51 - it's OK

	sheet.getcellbyposition(0,0).value = value
	print sheet.getcellbyposition(0,0).value

'must be 12.51 but I get 12.5100002288818 

End sub
Comment 1 amy2008 2008-09-17 04:01:33 UTC
Confirmed in OOo3.0_RC1 on WinXP


>Sub test
>	dim value as single
        dim value1 as double

>'must be single - with double the problem dissapears

>	sheet=thiscomponent.sheets(0)
>	value = 12.51        

>'value - any number with decimal part except *****.0 and *****.5
>'(for example 12.0 and 12.5 are not valid)

>	print value

>'I get 12.51 - it's OK

>	sheet.getcellbyposition(0,0).value = value
>	print sheet.getcellbyposition(0,0).value
        value1= value
        print value1
'sheet.getcellbyposition(0,0).value is the same as value1, it is double too. 
Muse be 12.51 but I get 12.5100002288818 

>End sub

So, in this way we can make sure it owes to the Star Basic. In the process of 
Single to Double, it doesn't work well.
Comment 2 amy2008 2008-09-17 04:02:22 UTC
CC to Li Meiying