I use the format bytes ($bytes / 1000) it can't be done because the rate has pair values, so how to change it?
Code: Select all
<td><?php echo formatBytes($rate,2);?> </td>
Code: Select all
function formatBytes($bytes, $decimal = null)
{
$satuan = [' Bytes', ' KB', ' MB', ' GB', ' TB'];
$i = 0;
while ($bytes > 1024){
$bytes /= 1024;
$i++;
}
return round($bytes, $decimal). '' . $satuan[$i];
}