Converts a decimal number to a binary string.

@param string $number The number to convert, positive or zero, only digits.

@return string
333522
private function toBinary(string $number) : string
    {
        $result = '';

        while ($number !== '0') {
            [$number, $remainder] = $this->divQR($number, '256');
            $result .= \chr((int) $remainder);
        }

        return \strrev($result);
    }
1057507
private function dec2bin( $decimal )
	{
		bcscale(0);
		$binary = '';
		do
		{
			$binary = bcmod( $decimal, '2' ) . $binary;
			$decimal = bcdiv( $decimal, '2' );
		} while ( bccomp( $decimal, '0' ) );

		return( $binary );
	}
983653
public function toTheN($number)
    {
        for ($i = 1; $i <= $number; $i++) {
            $this->multiply($this->number);
        }

        return $this;
    }
412931
public function encode($number)
    {
        $number = (int)$number;

        $result = array();

        if (0 === $number)
        {
            $result[] = $this->dictionary[0];
        }

        while ($number > 0)
        {
            $result[] = $this->dictionary[($number % $this->radix)];
            $number = floor($number / $this->radix);
        }

        return implode('', array_reverse($result));
    }
1237296
public static function bytesFrom($number) {
        if (!$number) {
            return 0;

        } else if (is_numeric($number)) {
            return $number;
        }

        $number = trim((string) $number);
        $sizes = array(
            'k|kb|ki|kib' => 10,
            'm|mb|mi|mib' => 20,
            'g|gb|gi|gib' => 30,
            't|tb|ti|tib' => 40,
            'p|pb|pi|pib' => 50,
            'e|eb|ei|eib' => 60,
            'z|zb|zi|zib' => 70,
            'y|yb|yi|yib' => 80,
            'b' => 0
        );

        foreach ($sizes as $format => $pow) {
            if (preg_match('/^([0-9\.]+)(' . $format . ')$/i', $number, $matches)) {
                return (((float) $matches[1]) * pow(2, $pow));
            }
        }

        return null;
    }
795581
public static function unFormat($number)
    {
        $number = str_replace('.', 'D', $number);
        $number = str_replace(',', '', $number);
        $number = str_replace('D', '.', $number);

        return $number;
    }
4053
public function base64Encode($number)
    {
        if ($number < 0 || $number > 63) {
            throw new \Exception(sprintf('Invalid number "%s" given. Must be between 0 and 63.', $number));
        }

        return $this->intToCharMap[$number];
    }
447439
private function round($number)
    {
        if (null !== $this->precision && null !== $this->roundingMode) {
            // shift number to maintain the correct precision during rounding
            $roundingCoef = pow(10, $this->precision);
            $number *= $roundingCoef;

            switch ($this->roundingMode) {
                case \NumberFormatter::ROUND_CEILING:
                    $number = ceil($number);
                    break;
                case \NumberFormatter::ROUND_FLOOR:
                    $number = floor($number);
                    break;
                case \NumberFormatter::ROUND_UP:
                    $number = $number > 0 ? ceil($number) : floor($number);
                    break;
                case \NumberFormatter::ROUND_DOWN:
                    $number = $number > 0 ? floor($number) : ceil($number);
                    break;
                case \NumberFormatter::ROUND_HALFEVEN:
                    $number = round($number, 0, PHP_ROUND_HALF_EVEN);
                    break;
                case \NumberFormatter::ROUND_HALFUP:
                    $number = round($number, 0, PHP_ROUND_HALF_UP);
                    break;
                case \NumberFormatter::ROUND_HALFDOWN:
                    $number = round($number, 0, PHP_ROUND_HALF_DOWN);
                    break;
            }

            $number /= $roundingCoef;
        }

        return $number;
    }
514703
public static function ordinalize($number)
    {
        static::init();

        if (\in_array($number % 100, range(11, 13), true)) {
            return $number . static::$ordinals['default'];
        }

        switch ($number % 10) {
            case 1:
                return $number . static::$ordinals['first'];
            case 2:
                return $number . static::$ordinals['second'];
            case 3:
                return $number . static::$ordinals['third'];
            default:
                return $number . static::$ordinals['default'];
        }
    }
747331
public function convertToTriplets($number)
    {
        $triplets = [];

        while ($number > 0) {
            $triplets[] = $number % 1000;
            $number = (int) ($number / 1000);
        }

        return array_reverse($triplets);
    }
757260
public static function formatColumnName($number)
    {
        for ($char = ''; $number >= 0; $number = (int) ($number / 26) - 1) {
            $char = \chr($number % 26 + 0x41) . $char;
        }

        return $char;
    }
48326
function internalNumber( $number )
    {
        if ( preg_match( '/^(['.$this->PositiveSymbol.']|['.$this->NegativeSymbol.'])?([0-9]*|[0-9]{1,3}(['.$this->ThousandsSeparator.'][0-9]{3,3})*)(['.$this->DecimalSymbol.'][0-9]+)?$/', trim( $number ) ) )
        {
            $number = str_replace( ' ', '', $number );
            if ( $this->PositiveSymbol )
                $number = str_replace( $this->PositiveSymbol, '', $number );
            $number = str_replace( $this->NegativeSymbol, '-', $number );
            $number = str_replace( $this->ThousandsSeparator, '', $number );
            $number = str_replace( $this->DecimalSymbol, '.', $number );
        }
        return $number;
    }
696411
public static function dec2big(string $number): string
    {
    	static::checkExtensionOrFail();

        $alphabet = static::NUMBERS;
        $number = trim((string)$number);

        if (strlen($number) == 0) {
            throw new Exception('Got empty number for dec2big, can not proceed');
        }

        $mod = (string)count($alphabet);
        $s = '';

        do {
            $x = bcdiv($number, $mod, 0);
            $left = bcmod($number, $mod);
            $char = $alphabet[$left];
            $s = $char . $s;

            $number = $x;
        } while ($x != '0');

        return $s;
    }
1279724
public static function mod10($number)
    {
        $checksum = '';
        foreach (str_split(strrev((string) $number)) as $i => $d) {
            $checksum .= ($i % 2 == 0) ? $d * 2 : $d;
        }
        return array_sum(str_split($checksum)) * 9 % 10;
    }
442418
public function parseString($number)
    {
        if (is_null($number)) {
            return '';
        }

        $matches = $this->execute($this->rawPhoneRegex, $number);

        if (sizeof($matches) > 0) {
            return $matches['numbers'];
        }

        return '';
    }
856499
private static function parseIntegerPart($number)
    {
        if ('' === $number || '0' === $number) {
            return '0';
        }

        if ('-' === $number) {
            return '-0';
        }

        $nonZero = false;

        for ($position = 0, $characters = strlen($number); $position < $characters; ++$position) {
            $digit = $number[$position];

            if (!isset(static::$numbers[$digit]) && !(0 === $position && '-' === $digit)) {
                throw new \InvalidArgumentException(
                    sprintf('Invalid integer part %1$s. Invalid digit %2$s found', $number, $digit)
                );
            }

            if (false === $nonZero && '0' === $digit) {
                throw new \InvalidArgumentException(
                    'Leading zeros are not allowed'
                );
            }

            $nonZero = true;
        }

        return $number;
    }
27360
function internalCurrency( $number )
    {
        if ( preg_match( '/^(['.$this->CurrencyPositiveSymbol.']|['.$this->CurrencyNegativeSymbol.'])?([0-9]*|[0-9]{1,3}(['.$this->ThousandsSeparator.'][0-9]{3,3})*)(['.$this->CurrencyDecimalSymbol.'][0-9]+)?$/', trim( $number ) ) )
        {
            $number = str_replace( ' ', '', $number );
            if ( $this->CurrencyPositiveSymbol )
                $number = str_replace( $this->CurrencyPositiveSymbol, '', $number );
            $number = str_replace( $this->CurrencyNegativeSymbol, '-', $number );
            $number = str_replace( $this->CurrencyThousandsSeparator, '', $number );
            $number = str_replace( $this->CurrencyDecimalSymbol, '.', $number );
        }
        return $number;
    }