Well, no, there isn't a built-in function (it certainly wouldn't be used as much as date()). It would make more sense to have a "metric()" function, to format SI units.
// $fsize is an integer, indicating the size of a file in bytes.
$suffix='B';
if($fsize>1024)
{ $suffix='kB';
$fsize/=1024.;
}
if($fsize>1024)
{ $suffix='MB';
$fsize/=1024.;
}
if($fsize>1024)
{ $suffix='GB';
$fsize/=1024.;
}
if($fsize>1024)
{ $suffix='TB';
$fsize/=1024.;
}
$fsize=round($fsize,2);
$fstring=$fsize.$suffix;