PHP KB to MB converstion
Posted: Fri Nov 25, 2011 11:28 am
So I'm doing a php script to list the files in a particular folder. I want to display the size in MB and here's the converstion code
now i have a file that is 650KB and when the php script converts it it becomes 0.6349515914917. Someone know how i can display only 2 decimal places(displays only 2 numbers after the point 0.63)?
Thanks
Code: Select all
$filesize = filesize("./images/". $filecrc);
$filesize = ($filesize / 1048576);
Thanks