summaryrefslogtreecommitdiffstats
path: root/pykolab/cli/cmd_list_quota.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-17 18:34:40 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-17 18:35:44 +0100
commit03d2c51bdcab00b1017fbf2222c1ed323d8a03cf (patch)
tree9b270813b28c5e3be6e7ce71ce391687cbf04375 /pykolab/cli/cmd_list_quota.py
parentb5876d49ef584268813e69d26fcf870199d635d7 (diff)
downloadpykolab-03d2c51bdcab00b1017fbf2222c1ed323d8a03cf.tar.gz
Make integers be floats before we make the division
Diffstat (limited to 'pykolab/cli/cmd_list_quota.py')
-rw-r--r--pykolab/cli/cmd_list_quota.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pykolab/cli/cmd_list_quota.py b/pykolab/cli/cmd_list_quota.py
index fece3c3..c81725a 100644
--- a/pykolab/cli/cmd_list_quota.py
+++ b/pykolab/cli/cmd_list_quota.py
@@ -59,7 +59,7 @@ def execute(*args, **kw):
print >> sys.stderr, _("The quota for folder %s is set to literally allow 0KB of storage.") % (quota_folder)
print "%d (Used: %d, Percentage: %s)" % (quota, used, u'\u221E')
else:
- percentage = round((used/quota)*100, 1)
+ percentage = round(((float)(used)/(float)(quota)) * 100.0, 1)
print "%d (Used: %d, Percentage: %d)" % (quota, used, percentage)
else:
print "No quota"
@@ -69,9 +69,9 @@ def execute(*args, **kw):
if not quota_root == None and not used == None and not quota == None:
if quota == 0:
print >> sys.stderr, _("The quota for folder %s is set to literally allow 0KB of storage.") % (quota_folder)
- print "%d (Used: %d, Percentage: %s)" % (quota, used, u'\u221E')
+ print "%d (Used: %d, Percentage: %d)" % (quota, used, u'\u221E')
else:
- percentage = round((used/quota)*100, 1)
+ percentage = round(((float)(used)/(float)(quota)) * 100.0, 1)
print "%d (Root: %s, Used: %d, Percentage: %d)" % (quota, quota_root, used, percentage)
else:
print "No quota"