Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG in round() function?!?
Message
De
30/01/2004 10:54:09
 
 
À
30/01/2004 10:02:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00871732
Message ID:
00872337
Vues:
37
Fabio,

One of the workarounds is to round the val() of the str() of the value to round like Vladimir shows in this topic:
http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~2,15,872317
? ROUND(VAL(STR(147.3250000000,20,15)),2)
? ROUND(VAL(STR(147.32500000000,20,15)),2)
An other one is to round the value to a 'safe' number of decimals before the actual round:
? ROUND(147.32500000000,2) && = 147,32 (wrong)
? ROUND(ROUND(147.32500000000,6),2) && = 147,33 (right)
Maybe there are more workaROUNDs(funny term in this case...).
For me these 2 are enough to deal with the problem.

Willem-Jan van Ede
Vektis BV
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform