$megabytes = $bytes / (1024 * 1024); $megabytes = number_format($megabytes, 2); // add commas and only 2 dec places