Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Round() giving different results
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00452446
Message ID:
00452468
Vues:
17
The result you get is affected by set("decimal").
For your particular case you should set decimal to 12 to get the same result.
However it looks like a bug. To reproduce it,try:
*---------------------
set deci to 12
?round(2390.00*.072500,2),round(2390.000000*0.072500,2) &&173.27,173.27
?round(173.275,2), round(173.275000000000,2) &&173.28,173.28
*--------------------

>>>>>>>>>>>>>>>>>>>>>>
If I do the following two commands I get different results. Am I missing something?

?round(2390.00*.072500,2)
173.28

?round(2390.000000*.072500,2)
173.27
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform