You are here

function minifyjs_format_filesize in Minify JS 7

Helper function to format the filesize.

1 call to minifyjs_format_filesize()
minifyjs_manage_javascript_files_form in ./minifyjs.admin.inc
Helper function for form table:

File

./minifyjs.admin.inc, line 334
Hook and helper functions for the Minify JS module.

Code

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