diff options
author | Johan Lundberg <lundberg@nordu.net> | 2014-10-22 18:01:41 +0200 |
---|---|---|
committer | Johan Lundberg <lundberg@nordu.net> | 2014-10-22 18:01:41 +0200 |
commit | b7d9314ec9a1e318acf1c7c9ce9b15a08ed400c7 (patch) | |
tree | 3cff3d3202430f6dcdde64d8557fff1037c5e60d /meetingtools | |
parent | 837b730407b580ead2d241050f8690ab5cbb9617 (diff) |
Round small values down to 0.
Diffstat (limited to 'meetingtools')
-rw-r--r-- | meetingtools/apps/content/views.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meetingtools/apps/content/views.py b/meetingtools/apps/content/views.py index ceec589..9ccd7fe 100644 --- a/meetingtools/apps/content/views.py +++ b/meetingtools/apps/content/views.py @@ -84,7 +84,7 @@ def cluster_report(request, cluster_name): 'domain': item['domain'], 'number_of_files': item['number_of_files'], 'storage_used': filesizeformat(item['domain_bytes']), - 'percent': '{:0.2g}%'.format(percent) + 'percent': '{0:0.2g}%'.format(int(round(percent))) }) return dicts_to_csv_response(data, header=['domain', 'number_of_files', 'storage_used', 'percent']) return HttpResponseForbidden() @@ -104,7 +104,7 @@ def domain_report(request, domain_name): 'username': item['username'], 'number_of_files': item['number_of_files'], 'storage_used': filesizeformat(item['bytecount']), - 'percent': '{:0.2g}%'.format(percent) + 'percent': '{0:0.2g}%'.format(int(round(percent))) }) return dicts_to_csv_response(data, header=['username', 'number_of_files', 'storage_used', 'percent']) - return HttpResponseForbidden()
\ No newline at end of file + return HttpResponseForbidden() |