>I use round() in my report designer and sum the result of my report.
> Then I write program to round up the number and sum it. The result is
> not the same. I get 0.01 differential.
>>What was your observation?? You have asked a rather open-ended question...
>>
>>>Hi,
>>> Has anyone found bug in round function of Visual Foxpro 3.0?
>>>I am not sure about this. How do you think about it?
That´s a "fact of life" with rounding: if you round numbers and sum them, the answer won´t be the same that if you sum them first and round afterwards. A quick example:
ROUND(6.67,0)+ROUND(6.67,0)+ROUND(6.67,0)= 7+7+7 = 21
ROUND(6.67+6.67+6.67,0) = ROUND(20.01,0) = 20
The best answer? There isn´t any, but you could either (1) set up things so you need no rounding (for example, always store rounded numbers, so you don´t need to round again), or (2) put an alert in your report as to the fact that due to roundings, totals might not coincide.
HTH!