From cc5e49433aa21f19ed4c404fac61e68f7ac3e513 Mon Sep 17 00:00:00 2001 From: Johannes Keyser Date: Thu, 25 May 2017 17:16:17 +0200 Subject: [PATCH] disks: restrict precision of reported available space on root partition --- plinth/modules/disks/views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plinth/modules/disks/views.py b/plinth/modules/disks/views.py index 032c92e31..9a91b35eb 100644 --- a/plinth/modules/disks/views.py +++ b/plinth/modules/disks/views.py @@ -74,19 +74,19 @@ def _format_bytes(size): return size if size < 1024: - return _('{disk_size} bytes').format(disk_size=size) + return _('{disk_size:.1f} bytes').format(disk_size=size) if size < 1024 ** 2: size /= 1024 - return _('{disk_size} KiB').format(disk_size=size) + return _('{disk_size:.1f} KiB').format(disk_size=size) if size < 1024 ** 3: size /= 1024 ** 2 - return _('{disk_size} MiB').format(disk_size=size) + return _('{disk_size:.1f} MiB').format(disk_size=size) if size < 1024 ** 4: size /= 1024 ** 3 - return _('{disk_size} GiB').format(disk_size=size) + return _('{disk_size:.1f} GiB').format(disk_size=size) size /= 1024 ** 4 - return _('{disk_size} TiB').format(disk_size=size) + return _('{disk_size:.1f} TiB').format(disk_size=size)