Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Only currency is sure computation decimals values ?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00798893
Message ID:
00850765
Views:
48
>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?
Previous
Reply
Map
View

Click here to load this message in the networking platform