Newscoop\NewscoopBundle\Controller\SystemPrefController::formatBytes PHP Метод

formatBytes() приватный Метод

private formatBytes ( $size, $precision = 2 )
    private function formatBytes($size, $precision = 2)
    {
        $base = log($size, 1024);
        $suffixes = array('', 'k', 'M', 'G');
        return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
    }