Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is a more accurate way to round numbers than Round(
Message
De
18/09/2003 13:00:24
 
 
À
18/09/2003 12:01:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00830026
Message ID:
00830383
Vues:
25
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform