Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Only currency is sure computation decimals values ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00798893
Message ID:
00850765
Vues:
47
>Hi Garrett,
>
>------
>Repeat after me: FLOATING POINT DOES NOT PRODUCE EXACT RESULTS. IF I WANT EXACT RESULTS, I WILL ROUND MY DATA.
>------
>
>See:
>
>http://support.microsoft.com/support/kb/articles/Q157/9/54.asp
>
>With this articles MS close the question:
>VFP haven't a precise and sure procedure for return correct rounding values.
CLEAR
mrate = 86.173125
mhours = 24.0000
mpay = mhours * mrate
? mpay
test=STR(mpay,LEN(STR(mpay)),LEN(STR(mpay)))
? ROUND(mpay, 2)
? ROUND(VAL(test),2)
Hmm, maybe that's because if you round to fewer decimal places than you have in the calculation, you lose data?
? ROUND(mPay, 10)
? ROUND(ROUND(mPay, 10), 2)
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform