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) size = make_tag_size(count, counts)
self.link(text, 'Surname', representative_handle[surname], size, self.link(text, 'Surname', representative_handle[surname], size,
"%s, %d%% (%d)" % (text, "%s, %d%% (%d)" % (text,
int((float(count)/total_surnames) * 100), int((float(count)/total_people) * 100),
count)) count))
self.append_text(" ") self.append_text(" ")
showing += 1 showing += 1

View File

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