Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ROUND()
Message
 
To
10/03/2000 09:04:22
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00342568
Message ID:
00344176
Views:
30
I'll tell you what I've done in cases like this. First of all, I go with a precision of a couple of decimals (999.99%). Along with this, I keep a running total of the rounded numbers. The last number that is calculated is changed so that the sum of the values will add to the desired result (in this case, 100%). If you need to check, you can verify that the calculated number is close to the "fudged" number. The reason I do this is that most people looking at the report don't mind/notice when a slight rounding error has occurred when calculating the percentage. But if it adds to 99.99%, something has gone incredibly wrong!!

Actually, where I have used this is when we calculate, say, a commission based on a total premium. But there is a detailed report breaking-down the commissions applied to each benefit. The commission based on the total premium can be a few pennies off the commission that is based on the addition of separate, rounded commission for each benefit. So, I "fudge" the calculation on the last benefit so that the sepated-by-benefit commissions add-up to the calculated commission based on the entire premium.

You might find that this is helpful. In my experience, people reading reports really like to see things add-up to what they expect. They are more likely to add a column that divide and/or multiply rows.

Take care,
Joe


>So what do you suggest?, is this an issue, or am I doing something wrong?
>
>Kev
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform