From eb31a163fac8b4b69e467e237f76894daaaf2521 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Fri, 3 Feb 2012 17:17:04 -0500 Subject: [PATCH] Added percentages to sections in profile --- profile.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/profile.html b/profile.html index 343a6b98e4..cd933d1836 100644 --- a/profile.html +++ b/profile.html @@ -107,10 +107,17 @@ $(function() {

- ${ hw['section'] } ${"({0}/{1})".format( hw['section_total'][0], hw['section_total'][1] )}

- + <% + earned = hw['section_total'][0] + total = hw['section_total'][1] + percentageString = "{:.0%}".format( float(earned)/total) if earned > 0 else "" + %> + ${ hw['section'] } ${"({}/{}) {}".format( earned, total, percentageString )}