Divide by total number of people to get percentage

svn: r11618
This commit is contained in:
Doug Blank 2009-01-13 21:53:33 +00:00
parent 68fed70200
commit 57e07cfd22
2 changed files with 5 additions and 4 deletions

View File

@ -370,7 +370,7 @@ class SurnameCloudGramplet(Gramplet):
size = make_tag_size(count, counts)
self.link(text, 'Surname', representative_handle[surname], size,
"%s, %d%% (%d)" % (text,
int((float(count)/total_surnames) * 100),
int((float(count)/total_people) * 100),
count))
self.append_text(" ")
showing += 1

View File

@ -120,9 +120,10 @@ class GivenNameCloudGramplet(Gramplet):
text = givensubname
size = make_tag_size(count, counts)
self.link(text, 'Given', text, size,
"%s, %d%% (%d)" % (text,
int((float(count)/total_givensubnames) * 100),
count))
"%s, %.2f%% (%d)" %
(text,
(float(count)/total_people) * 100,
count))
self.append_text(" ")
showing += 1
self.append_text(("\n\n" + _("Total unique given names") + ": %d\n") %