From b9eda0c9541c652735f1dc4b8cab024c7a940d7e Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 15 May 2021 22:58:37 +0200 Subject: mail/attachment: add 'B' suffix to under-kB sizes Displaying just a plain number leaves the user confused as to what the number means. --- alot/mail/attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alot/mail/attachment.py b/alot/mail/attachment.py index b8673fb9..33c651d2 100644 --- a/alot/mail/attachment.py +++ b/alot/mail/attachment.py @@ -17,7 +17,7 @@ def _humanize_size(size): :returns: the human readable representation of size :rtype: str """ - for factor, format_string in ((1, '%i'), + for factor, format_string in ((1, '%iB'), (1024, '%iKiB'), (1024 * 1024, '%.1fMiB')): if size / factor < 1024: -- cgit v1.2.3