On 7/13/2010 9:06 AM Robin Becker said...

Anyhow does anyone have a good algorithm for ensuring rounded
percentages do add up to 100%? :) How about grouped percentages ie
ensure the group sums and the groups display correctly in rounded form.

I generally do the calculations in memory then set the
largest to 100 - sum(rounded(others)).  (Same as for
double entry bookkeeping to ensure debits == credits)

Emile



--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to