commit 7c7dca22ff1ba9092c86b67fa25593c7c60a395a
parent 199e895e1a68d391b77c9179fc30fbe23c2b460b
Author: Sharif Olorin <sio@tesser.org>
Date: Fri, 31 Jul 2015 13:14:19 +0000
Use standard unit abbreviations and prefixes for attachment size
'k', 'm', et cetera are probably clear enough for most users to
interpret, but not all (personally, I keep getting caught by 'b' when
I'm sleep-deprived - that should be 'bits', but I know what the authors
mean is 'bytes'/'B').
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/sup/util.rb b/lib/sup/util.rb
@@ -464,13 +464,13 @@ class Numeric
def to_human_size
if self < 1024
- to_s + "b"
+ to_s + "B"
elsif self < (1024 * 1024)
- (self / 1024).to_s + "k"
+ (self / 1024).to_s + "KiB"
elsif self < (1024 * 1024 * 1024)
- (self / 1024 / 1024).to_s + "m"
+ (self / 1024 / 1024).to_s + "MiB"
else
- (self / 1024 / 1024 / 1024).to_s + "g"
+ (self / 1024 / 1024 / 1024).to_s + "GiB"
end
end
end