src/Reporter/Text.php
public function readableSize($value, $precision = 0, $base = 1000)
    {
        $i = 0;
        if (!$value) {
            return '0';
        }
        $isNeg = false;
        if ($value < 0) {
            $isNeg = true;
            $value = -$value;
        }
        if ($value >= 1) {
            $units = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
            while (($value / $base) >= 1) {
                $value = $value / $base;
                $i++;
            }
            $unit = isset($units[$i]) ? $units[$i] : '?';
        } else {
            $units = ['', 'm', 'µ', 'n', 'p', 'f', 'a', 'z'];
            while (($value * $base) <= $base) {
                $value = $value * $base;
                $i++;
            }
            $unit = isset($units[$i]) ? $units[$i] : '?';

        }
        return round($isNeg ? -$value : $value, $precision) . $unit;
    }
public function readableSize($value, $precision = 0, $base = 1000)
    {
        $i = 0;
        if (!$value) {
            return '0';
        }
        $isNeg = false;
        if ($value < 0) {
            $isNeg = true;
            $value = -$value;
        }
        if ($value >= 1) {
            $units = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
            while (($value / $base) >= 1) {
                $value = $value / $base;
                $i++;
            }
            $unit = isset($units[$i]) ? $units[$i] : '?';
        } else {
            $units = ['', 'm', 'µ', 'n', 'p', 'f', 'a', 'z'];
            while (($value * $base) <= $base) {
                $value = $value * $base;
                $i++;
            }
            $unit = isset($units[$i]) ? $units[$i] : '?';

        }
        return round($isNeg ? -$value : $value, $precision) . $unit;
    }
Humanizes values using an appropriate unit.

@return integer $value     The value.
@return integer $precision The required precision.
@return integer $base      The unit base.
@return string             The Humanized string value.