Skip to content

Commit

Permalink
Merge pull request #196 from Outernet-Project/fix/diskspace-perc-9992…
Browse files Browse the repository at this point in the history
…9550

Fixed percentage always 0 in diskspace indicator
  • Loading branch information
Branko Vukelic committed Jul 29, 2015
2 parents b22aa70 + db0fbaa commit 5dca3c1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%namespace name="widgets" file="../_widgets.tpl"/>

<%def name="space(free, total)">
<% pct = round(free / total * 100, 1) if total != 0 else 100 %>
<% pct = round((total - free) / float(total) * 100, 1) if total else 100 %>
## Translators, %s is the amount of free space in bytes, KB, MB, etc.
${widgets.progress(_('Total space (%s free)') % h.hsize(free), pct)}
</%def>
Expand Down

0 comments on commit 5dca3c1

Please sign in to comment.