On Fri, 24 Dec 2004 04:15:10 -0500, Sebastian
<[EMAIL PROTECTED]> wrote:
> i made this function and want to know if i am doing the math correctly..
> seems to be caculating ok.. $filesize is in bytes.. if the filesize is under
> 1MB i want to show KBs, if its under 1GB i want to show MB, if its ove
Well, depends on your definition of a kb, mb, gb, etc..
You seem to be mixing definitions here.
One school of thought is that...
1000 bytes = 1 kb
1000 kb = 1 mb
1000 mb = 1 gb
In reality...
1024 bytes = 1 kb
1024 kb = 1 mb
1024 mb = 1 gb
You're checking filesize against the '1000' method the
i made this function and want to know if i am doing the math correctly..
seems to be caculating ok.. $filesize is in bytes.. if the filesize is under
1MB i want to show KBs, if its under 1GB i want to show MB, if its over
1000MB i want to show GB, makes sense? ;)
function byte_format($filesize)
{
3 matches
Mail list logo