Publisher review:Format File Sizes - Given a byte size, returns a formatted string, e.g. 128M. Works all the way up to yottabytes (280) Source Code
function filesize_format($size = 0, $decimals = 0) { static $units = array('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'); if (empty($size)) return '-'; $unit = floor(log($size) / log(1024)); $value = round($size / pow(1024, $unit), $decimals); return number_format($value, $decimals) . $units[$unit];}
Format File Sizes is a PHP script for Snippets scripts design by Arto Bendiken.
It runs on following operating system: Windows / Linux / BSD.
Operating system:Windows / Linux / BSD