Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounding problem?
Message
From
20/03/2000 17:03:26
 
 
To
20/03/2000 16:47:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00348122
Message ID:
00348130
Views:
23
Janet,

>When the following numbers are multiplied then rounded to two decimals the result is 33.00 instead of the expected 33.01.
>
> .35000000 * 943.0 *.100 = 33.005000000000
> ROUND(.35000000 * 943.0 *.100 ,2) = 33.00
>
> ROUND(33.005000000000,2) = 33.01

It is interesting that just dropping off one of the zeroes from one of the three numbers will give you the correct answer, for example:
ROUND(.35000000 * 943.0 *.100 ,2) = 33.00
ROUND(.3500000 * 943.0 * .100, 2) = 33.01
ROUND(.35000000 * 943. * .100, 2) = 33.01
ROUND(.35000000 * 943.0 * .10, 2) = 33.01
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform