Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ROUND Function unattended result
Message
 
À
23/03/1999 09:40:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00200906
Message ID:
00200927
Vues:
9
Hi Marc,

>? X => 1851.07 instead of 1851.08 (Non rounded value is 1851.075)

When you issue:

n = 2
X = INT(X*10^(n+1))/10^(n+1)

You can see that FoxPro reports 1851.074, probably the value is internally stored as 1851.07499999999999999, which makes it print like 1851.075 when you display it on the screen. You get the correct result by setting n to 3 in the lines above and then round the result.

Christof
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform