public static function prettyMemory($total) { $total = intval($total); $ret = "unknown"; if ($total > 999) { $total = round($total / 1024, 2); $ret = "{$total} GB"; } else { $ret = "{$total} MB"; } return $ret; }