Skip to content

Commit

Permalink
Actually pass floats when formatting '%f'.
Browse files Browse the repository at this point in the history
Some of these were pointed out by Anonymous on SourceForge bug #2830659.
  • Loading branch information
hoxu committed Oct 26, 2009
1 parent 66ce243 commit d04805b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gitstats
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ class HTMLReportCreator(ReportCreator):
authors.reverse()
commits = data.author_of_month[yymm][authors[0]]
next = ', '.join(authors[1:5])
f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td></tr>' % (yymm, authors[0], commits, (100 * commits) / data.commits_by_month[yymm], data.commits_by_month[yymm], next))
f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td></tr>' % (yymm, authors[0], commits, (100.0 * commits) / data.commits_by_month[yymm], data.commits_by_month[yymm], next))

f.write('</table>')

Expand All @@ -687,7 +687,7 @@ class HTMLReportCreator(ReportCreator):
authors.reverse()
commits = data.author_of_year[yy][authors[0]]
next = ', '.join(authors[1:5])
f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td></tr>' % (yy, authors[0], commits, (100 * commits) / data.commits_by_year[yy], data.commits_by_year[yy], next))
f.write('<tr><td>%s</td><td>%s</td><td>%d (%.2f%% of %d)</td><td>%s</td></tr>' % (yy, authors[0], commits, (100.0 * commits) / data.commits_by_year[yy], data.commits_by_year[yy], next))
f.write('</table>')

f.write('</body></html>')
Expand Down Expand Up @@ -762,7 +762,7 @@ class HTMLReportCreator(ReportCreator):
f.write('<dl>')
f.write('<dt>Total tags</dt><dd>%d</dd>' % len(data.tags))
if len(data.tags) > 0:
f.write('<dt>Average commits per tag</dt><dd>%.2f</dd>' % (data.getTotalCommits() / len(data.tags)))
f.write('<dt>Average commits per tag</dt><dd>%.2f</dd>' % (1.0 * data.getTotalCommits() / len(data.tags)))
f.write('</dl>')

f.write('<table>')
Expand Down

0 comments on commit d04805b

Please sign in to comment.