Welcome to the Cookbook

loading...

7.6.4 toReadableSize

Todavia no hay una traducion de este texto. Por favor ayudanos y traducirla.. Mas info sobre traduciones

toReadableSize(string $data_size)

This method formats data sizes in human readable forms. It provides a shortcut way to convert bytes to KB, MB, GB, and TB. The size is displayed with a two-digit precision level, according to the size of data supplied (i.e. higher sizes are expressed in larger terms):

echo $number->toReadableSize(0);  // 0 Bytes
echo $number->toReadableSize(1024); // 1 KB
echo $number->toReadableSize(1321205.76); // 1.26 MB
echo $number->toReadableSize(5368709120); // 5.00 GB
  1. echo $number->toReadableSize(0); // 0 Bytes
  2. echo $number->toReadableSize(1024); // 1 KB
  3. echo $number->toReadableSize(1321205.76); // 1.26 MB
  4. echo $number->toReadableSize(5368709120); // 5.00 GB