Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is a more accurate way to round numbers than Round(
Message
From
18/09/2003 13:00:24
 
 
To
18/09/2003 12:01:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00830026
Message ID:
00830383
Views:
26
Hi Elmer,

This is normal, because VFP known only floating point as numeric variable.

try this:
*!*Manually entered same number
&& this number not exist on floating point domain
m.lnTotalAVGmanual = 58271.27004999990000
?str(m.lnTotalAVGmanual-58271,25,16)
* now you known that next number exists on floating point
m.lnTotalAVGmanual= 58271.27004999989731
?str(m.lnTotalAVGmanual-58271,25,16)

* found your sum true number, removing left integer fp number
*The result from SUM was determined by 
?str(m.lnTotalAVG1-58271,25,16)
if you compare the two decimal part of
m.lnTotalAVG-58271
and
m.lnTotalAVG1-58271

you can see the true values.

VFP can do exact sum only on integer and currency fields.

Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform