From 6b85f8cf12f7d83bc7a6a599b48abe779dc263f0 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 5 Nov 2016 21:32:08 +0100 Subject: CLI: IEC prefix (binary) for units Updated according to https://wiki.ubuntu.com/UnitsPolicy (I got confused due `ls`, which is still using 1024 but is listed as an exception) And use the formatting function already included in FreshRSS --- lib/lib_rss.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 143b55bee..fc68a96d3 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -127,6 +127,8 @@ function format_bytes($bytes, $precision = 2, $system = 'IEC') { } elseif ($system === 'SI') { $base = 1000; $units = array('B', 'KB', 'MB', 'GB', 'TB'); + } else { + return format_number($bytes, $precision); } $bytes = max(intval($bytes), 0); $pow = $bytes === 0 ? 0 : floor(log($bytes) / log($base)); -- cgit v1.2.3