Using the upload file size bindings
I am using the file manipulation 'file size' binding to display the size of a file I have uploaded on my detail pages. The only problem is that it displays as bytes e,g 1mb is displaying like 1024000.
I found this code on the net
$size = $bytes / 1024;
if($size < 1024)
$size = number_format($size, 2);
$size .= ' KB';
if($size / 1024 < 1024)
$size = number_format($size / 1024, 2);
$size .= ' MB';
else if ($size / 1024 / 1024 < 1024)
$size = number_format($size / 1024 / 1024, 2);
$size .= ' GB';
// Returns '19.28mb'
I just do not know how I would combine this with my echo statement to get this to work
Your help is much appreciated