From bf9a1e696a6fe4e069db6fd22bdb10f48ebcfbe6 Mon Sep 17 00:00:00 2001 From: Darko Date: Fri, 4 Apr 2014 14:28:32 +0200 Subject: [PATCH] Fixed size display for prehash. --- bin/monitor.php | 2 +- lib/prehash.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/monitor.php b/bin/monitor.php index 6ee68f723..d1c201a0e 100644 --- a/bin/monitor.php +++ b/bin/monitor.php @@ -9,7 +9,7 @@ require_once(dirname(__FILE__)."/../lib/showsleep.php"); require_once(dirname(__FILE__)."/../lib/functions.php"); -$version="0.3r1059"; +$version="0.3r1060"; $db = new DB(); $functions = new Functions(); diff --git a/lib/prehash.php b/lib/prehash.php index 04c0f53ce..16da990a3 100644 --- a/lib/prehash.php +++ b/lib/prehash.php @@ -1320,6 +1320,10 @@ Class PreHash */ function bytesToSizeString($bytes, $precision = 0) { + if ($bytes == 0) { + return '0B'; + } + $unit = array('B','KB','MB','GB','TB','PB','EB'); return round($bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision) . $unit[(int)$i]; }