private function formatSize($size)
    {
        $suffixes = array('', 'K', 'M', 'G', 'T', 'P');
        reset($suffixes);

        $suffix = current($suffixes);

        while ($size > 1023) {
            next($suffixes);

            if (null === key($suffixes)) {
                break;
            }

            $size /= 1024;
            $suffix = current($suffixes);
        }

        if ($size < 10) {
            return number_format($size, 1).$suffix;
        }

        return round($size).$suffix;
    }