@param int $size

@return string
356346
private function humanFileSize(int $size): string
    {
        if ($size >= 1 << 30) {
            return number_format($size / (1 << 30), 1) . "G";
        }

        if ($size >= 1 << 20) {
            return number_format($size / (1 << 20), 1) . "M";
        }
        if ($size >= 1 << 10) {
            return number_format($size / (1 << 10), 1) . "K";
        }

        return $size;
    }
1333715
public function setSize($size) {
		if (is_int($size)) {
			return $this->addToMemberCtrl($this->mClass, CssRef::sizes("input-group")[$size],CssRef::sizes("input-group"));
		}
		return $this->addToMemberCtrl($this->mClass, $size, CssRef::sizes("input-group"));
	}
312683
public function getImageUrl($size = 'thumbnail')
    {
        $res = wp_get_attachment_image_src($this->getId(), $size);
        return $res && isset($res[0]) ? $res[0] : null;
    }
1053164
private static function parseSize($size)
    {
        // Remove the non-unit characters from the size.
        $unit = preg_replace('/[^bkmgtpezy]/i', '', $size);

        // Remove the non-numeric characters from the size.
        $size = preg_replace('/[^0-9\.]/', '', $size);

        // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by.
        if ($unit) {
            return round($size * pow(1024, stripos('bkmgtpezy', $unit[0])));
        }

        return round($size);
    }
118168
public static function getImageSize( string $size = 'thumbnail') {
		$sizes = self::getImageSizes();
		$size  = key_exists( $size, $sizes ) ? $size : 'thumbnail';

		return $sizes[ $size ];
	}
1365576
public static function size ($size, $unit = '')
		{
			if (is_numeric($size) and $size >= 0)
			{
				if (( !$unit && $size >= 1 << 30 ) || $unit == 'GB')
					return round($size / ( 1 << 30 )) . ' GB';
				if (( !$unit && $size >= 1 << 20 ) || $unit == 'MB')
					return round($size / ( 1 << 20 )) . ' MB';
				if (( !$unit && $size >= 1 << 10 ) || $unit == 'KB')
					return round($size / ( 1 << 10 )) . ' KB';

				return round($size) . ' B';
			}

			return null;
		}
340306
public function getCoverFile($size)
    {
        $coverFilename = $this->coverFilename;

        //get the extension
        $extension = explode('.', $coverFilename);
        $extension = array_pop($extension);

        //remove file extension
        $name = preg_replace('#\.[^.]*$#', '', $coverFilename);
        $coverFilename = $name.'_'.$size.'.'.$extension;

        return $coverFilename;
    }
301651
public static function getSize( $size )
    {
        $dim = [];
        if( is_array( $size ) )
        {
            $dim[ 'w' ] = $size[0];
            $dim[ 'h' ] = isset( $size[1] ) ? $size[1] : $size[0];
        }
        else
        {
            $dim[ 'w' ] = $size;
            $dim[ 'h' ] = null;
        }

        return $dim;
    }
505184
public function getPixelValue(string $size)
    {
        $value = preg_replace('/[^0-9.-]+/', '', $size);
        $unit = preg_replace('/[^acehimnprtvwx%]/', '', $size);

        // Convert 16px = 1em = 2ex = 12pt = 1pc = 1/6in = 2.54/6cm = 25.4/6mm = 100%
        switch ($unit) {
            case '':
            case 'px':
                return (int) round($value);

                break;

            case 'em':
                return (int) round($value * 16);

                break;

            case 'ex':
                return (int) round($value * 16 / 2);

                break;

            case 'pt':
                return (int) round($value * 16 / 12);

                break;

            case 'pc':
                return (int) round($value * 16);

                break;

            case 'in':
                return (int) round($value * 16 * 6);

                break;

            case 'cm':
                return (int) round($value * 16 / (2.54 / 6));

                break;

            case 'mm':
                return (int) round($value * 16 / (25.4 / 6));

                break;

            case '%':
                return (int) round($value * 16 / 100);

                break;
        }

        return 0;
    }
131343
protected function _fromByteString($size)
    {
        if (is_numeric($size)) {
            return (integer) $size;
        }

        $type  = trim(substr($size, -2, 1));

        $value = substr($size, 0, -1);
        if (!is_numeric($value)) {
            $value = substr($value, 0, -1);
        }

        switch (strtoupper($type)) {
            case 'Y':
                $value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024);
                break;
            case 'Z':
                $value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024);
                break;
            case 'E':
                $value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024);
                break;
            case 'P':
                $value *= (1024 * 1024 * 1024 * 1024 * 1024);
                break;
            case 'T':
                $value *= (1024 * 1024 * 1024 * 1024);
                break;
            case 'G':
                $value *= (1024 * 1024 * 1024);
                break;
            case 'M':
                $value *= (1024 * 1024);
                break;
            case 'K':
                $value *= 1024;
                break;
            default:
                break;
        }

        return $value;
    }
1122650
protected static function pad($input, $size)
    {
        $input = str_pad(
            $input,
            Cuid::BASE36,
            '0',
            STR_PAD_LEFT
        );

        return substr($input, strlen($input) - $size);
    }
608471
public function getCoverFile($size)
    {
        if (strpos($this->coverFilename, '/')) {
            $cover = str_replace('/', '/covers/'.$size, $this->coverFilename);
        } else {
            $cover = $this->component.'/covers/'.$size.$this->coverFilename;
        }

        return $cover;
    }
1265564
public static function format_size($size)
    {
        if ($size < 1024) {
            return $size . ' bytes';
        }
        if ($size < 1024*1024) {
            return round($size/1024) . ' KB';
        }
        if ($size < 1024*1024*10) {
            return round(($size/(1024*1024))*10)/10 . ' MB';
        }
        if ($size < 1024*1024*1024) {
            return round($size/(1024*1024)) . ' MB';
        }
        return round(($size/(1024*1024*1024))*10)/10 . ' GB';
    }
1124171
public function source(Size $size): string
    {
        return $this->maker()->make($this->name, $this->options($size));
    }
1001366
public function setSize($size) {
		if (is_int($size)) {
			return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination"));
		}
		if(!PhalconUtils::startsWith($size, "pagination-") && $size!=="")
			$size="pagination-".$size;
		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination"));
	}
221797
public function getAvatarUrl($size = 200) {
    $protocol = \Yii::$app->request->isSecureConnection ? 'https' : 'http';

    return $protocol . '://gravatar.com/avatar/' . $this->gravatar_id . '?s=' . $size;
  }
1100342
public function multiply(Size $size): Size
    {
        $this->bit = $this->bit * $size->get('b');
        return $this;
    }