Converts this size to another system.
@param string $system system to convert to
@return Size this size
770734
public function to($system)
    {
        $this->value = $this->lookup($system);
        $this->system = $system;
        return $this;
    }
515095
public static function Empty( bool $fixed = false ) : Size
   {

      if ( $fixed )
      {
         return \is_null( static::$emptyFixed )
            ? ( static::$emptyFixed = new Size( 0, 0, true ) )
            : static::$emptyFixed;
      }

      return new Size( 0, 0, $fixed );

   }
663948
public static function getUsage($system=false, $peak = true) {
        if ($peak) {
            $mem = memory_get_peak_usage($system);
        } else {
            $mem = memory_get_usage($system);
        }

       $unit=array('b','kb','mb','gb','tb','pb');
       return round($mem/pow(1024,($i=floor(log($mem,1024)))),2).' '.$unit[$i];
    }
100521
public function setConsoleSize(array $consoleSize)
    {
        $this->consoleSize = $consoleSize;

        $this->hostConfig = array_merge($this->hostConfig, ['ConsoleSize' => $consoleSize]);

        return $this;
    }
32183
public function size( $size ) {
		$this->width  = (int) $size;
		$this->height = (int) $size;

		return $this;
	}
978245
public function transliterate($str, $system = null) {
        if(is_null($system)) {
            $system = $this->system;
        }
        if(is_null($system)) {
            throw new RuntimeException("Transliteration system is not defined");
        }
        return $system->transliterate($str);
    }
1055299
public function pageSize($pageSize = null)
    {
        if ($pageSize === null) {
            return $this->_pageSize;
        }
        $this->_pageSize = $pageSize;

        return $this;
    }
1081495
public function tableSize(string $tableName)
    {
        $tables = $this->tablesSize();

        if (isset($tables[$tableName])) {
            return $tables[$tableName];
        }

        return null;
    }
989274
public static function toReadableSize($bytes, $decimals = 1, $system = 'metric')
    {
        $mod = ($system === 'binary') ? 1024 : 1000;

        $units = [
            'binary' => [
                'B',
                'KiB',
                'MiB',
                'GiB',
                'TiB',
                'PiB',
                'EiB',
                'ZiB',
                'YiB',
            ],
            'metric' => [
                'B',
                'kB',
                'MB',
                'GB',
                'TB',
                'PB',
                'EB',
                'ZB',
                'YB',
            ],
        ];

        $factor = floor((strlen($bytes) - 1) / 3);

        return sprintf("%.{$decimals}f %s", $bytes / pow($mod, $factor), $units[$system][$factor]);
    }
1306744
public function setSize($size) {
		if (is_int($size)) {
			return $this->addToProperty("class", CssRef::sizes("btn-group")[$size]);
		}
		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("btn-group"));
	}
1043873
public function sizes($sizes = null)
    {

        if ($sizes) {
            $this->sizes = $sizes;

            return $this;
        }

        return empty($this->sizes) ? '100vw' : $this->sizes;
    }
1372646
public function iniHumanFriendlySize($size){

        switch( substr($size,-1) ) {
            case 'G':
                $size = $size * 1024;
            case 'M':
                $size = $size * 1024;
            case 'K':
                $size = $size * 1024;
        }//switch

        return $this->humanFileSize($size);

    }
522764
public static function _toReadableSize($size, $decimals = '.') {
		$size = parent::toReadableSize($size);
		if ($decimals !== '.') {
			$size = str_replace('.', $decimals, $size);
		}
		return $size;
	}
687561
protected function getSize($value)
    {
        if (is_numeric($value)) {
            return $value;
        }

        if (is_array($value) || $value instanceof Countable) {
            return count($value);
        }

        return mb_strlen($value);
    }
110031
public function lsize($key)
    {
        try {
            return $this->redis->lsize($key);
        } catch (\RedisException $e) {
            die("Error!: " . $e->getMessage() . "<br/>");
        }
    }
1371505
public function setSize($size)
    {
        if (is_string($size) && $parsed = $this->parseSizeWord($size)) {
            $this->size = $parsed;
        } else {
            $this->size = $size;
        }
        return $this;
    }
884833
function getsize($size) {
        if ($size === null) return null;
        $last = strtolower($size{strlen($size)-1});
        $size = (int) $size;
        switch($last) {
            case 'g':
                $size *= 1024;
            case 'm':
                $size *= 1024;
            case 'k':
                $size *= 1024;
        }
        return $size;
    }