Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Round() Bug
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Round() Bug
Divers
Thread ID:
00459503
Message ID:
00459503
Vues:
55
Hi,

I wrote a new function to handle the round() bug that exists in VFP. I was curious if anyone sees a reason that this won't work.

Thanks,
Paul
lparameters tnNumber tndecimals

* The reason we added this new round function is because Microsoft has confirmed a bug with the round() command
* after doing several calculations on the variable you are trying to round.
* http://support.microsoft.com/support/kb/articles/Q157/9/54.asp?LN=EN-US&SD=msdn&FR=0&qry=round%28%29&rnk=3&src=DHCS_MSPSS_msdn_SRCH&SPR=FOX
* Article ID: Q157954

* basically we are  change the number to a string with the # of decimal positions calculated by
* adding one to the precision that is desired. then switching the string back to numeric.

return round(val(alltrim(str(tnNumber,20,tnDecimals+1))),tndecimals)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform