summaryrefslogtreecommitdiffstats
path: root/pykolab
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:34:40 +0100
commit11408ada162194049823c35099f87575e1fdfd24 (patch)
treee0f1ec046544351fea8bf3ff0a0daa8e4e50f50f /pykolab
parent79953231f11bac98efe9b85276a3210474fd0e74 (diff)
downloadpykolab-11408ada162194049823c35099f87575e1fdfd24.tar.gz
Make integers be floats before we make the division
Diffstat (limited to 'pykolab')
-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"