Fixed size display for prehash.

This commit is contained in:
Darko
2014-04-04 14:28:32 +02:00
parent 62acd25085
commit bf9a1e696a
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -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();
+4
View File
@@ -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];
}