Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ROUND()
Message
From
08/03/2000 15:02:33
 
 
To
08/03/2000 11:44:02
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00342568
Message ID:
00343398
Views:
29
>I want all my calculations to be to 1 decimal place.
>
>7/74*100 (the sum currently in hand) should = 9.5.
>
>When I do ROUND(7/74*100,0) I get 9 when 9.5 rounded is actually 10.
>
>To explain more, I have a report that calculates various figures and in the totals are the percentages as well. The only problem is that the total does not reach 100%, it reaches 99%.

Since you want to round to 0 decimal places, but want the number to round to the nearest 10th, try this:

ROUND(7/74*100+.05,0)

Add 1/2 the unit of the decimal place you want to round to.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform