@param $number

@return self
485730
public static function fromString($number)
    {
        $decimalSeparatorPosition = strpos($number, '.');
        if ($decimalSeparatorPosition === false) {
            return new self($number, '');
        }

        return new self(
            substr($number, 0, $decimalSeparatorPosition),
            rtrim(substr($number, $decimalSeparatorPosition + 1), '0')
        );
    }
1020505
public function getPage(int $number): self
    {
        return $this->loadPage($this->links->expand(self::REL_PAGE, [self::PAGE_VARIABLE => $number]));
    }
1054564
public function setError($error, $number)
    {
        $this->curlError = $error;
        $this->curlErrorNo = $number;

        return $this;
    }
1361958
public function withPhoneNumber($phoneNumber)
    {
        if ($phoneNumber) {
            $phoneNumber = $phoneNumber instanceof PhoneNumber
                ? $phoneNumber
                : new PhoneNumber($phoneNumber)
            ;
        }
        $request = clone $this;
        $request->phoneNumber = $phoneNumber;

        return $request;
    }
89165
public function set($number)
    {
        $this->setCurrentValue($number);
        $this->currentOperation = 'add';
        $this->addToHistory('set', $number);
        return $this;
    }
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'];
        }
    }
666451
public function equals($number): bool
    {
        if (!($number instanceof Number)) {
            return false;
        }
        
        return $this->number === $number->number;
    }
430219
public function base10($number)
    {
        if (!is_int($number)) {
            throw new \InvalidArgumentException('Expecting integer');
        }

        if ($this->integerPart === '0' && !$this->fractionalPart) {
            return $this;
        }

        $sign = '';
        $integerPart = $this->integerPart;

        if ($integerPart[0] === '-') {
            $sign = '-';
            $integerPart = substr($integerPart, 1);
        }

        if ($number >= 0) {
            $integerPart = ltrim($integerPart, '0');
            $lengthIntegerPart = strlen($integerPart);
            $integers = $lengthIntegerPart - min($number, $lengthIntegerPart);
            $zeroPad = $number - min($number, $lengthIntegerPart);

            return new self(
                $sign.substr($integerPart, 0, $integers),
                rtrim(str_pad('', $zeroPad, '0').substr($integerPart, $integers).$this->fractionalPart, '0')
            );
        }

        $number = abs($number);
        $lengthFractionalPart = strlen($this->fractionalPart);
        $fractions = $lengthFractionalPart - min($number, $lengthFractionalPart);
        $zeroPad = $number - min($number, $lengthFractionalPart);

        return new self(
            $sign.ltrim($integerPart.substr($this->fractionalPart, 0, $lengthFractionalPart - $fractions).str_pad('', $zeroPad, '0'), '0'),
            substr($this->fractionalPart, $lengthFractionalPart - $fractions)
        );
    }
1236914
public function greaterStrict($number)
    {
        if (!is_int($number) && !is_float($number)) {
            throw new InvalidIntOrFloatException('number', $number);
        }

        if (!is_int($this->value) && !is_float($this->value)) {
            throw new InvalidIntOrFloatException($this->name, $this->value);
        } elseif ($this->value <= $number) {
            throw new NumberNotGreaterStrictlyException($this->name, $this->value, $number);
        }

        return $this;
    }
195780
protected function normalizeNumber($number) {
        list(, $value, $unit) = $number;
        if (isset(self::$unitTable["in"][$unit])) {
            $conv = self::$unitTable["in"][$unit];
            return array("number", $value / $conv, "in");
        }
        return $number;
    }
49325
public function limit($number)
    {
        $this->iterator = Iterators::limit($this->iterator, $number);
        return $this;
    }
766278
public static function forAverage(callable $num): self {
        return new self(
                function() { return [0, 0]; },
                function(&$result, $arg) use($num) { $result[0] += $num($arg); $result[1]++; },
                function($result) { return $result[0] / $result[1]; }
        );
    }
905110
public function setMinor($number)
    {
        if (!Validator::isNumber($number)) {
            throw new InvalidNumberException($number);
        }

        $this->minor = intval($number);

        return $this;
    }
655559
public function divide($number)
    {
        self::mustBeNumeric($number, 'Value to divide');
        
        $number = is_object($number) ? $number->value : $number;
        
        if ($number == 0) {
            throw new \InvalidArgumentException('You cannot divide by zero!');
        }

        return new self($this->value / $number);
    }
927103
function formatNumber( $number )
    {
        $neg = $number < 0;
        $num = $neg ? -$number : $number;
        $text = number_format( $num, $this->FractDigits, $this->DecimalSymbol, $this->ThousandsSeparator );
        return ( $neg ? $this->NegativeSymbol : $this->PositiveSymbol ) . $text;
    }
959961
public function setPatch($number)
    {
        if (!Validator::isNumber($number)) {
            throw new InvalidNumberException($number);
        }

        $this->patch = intval($number);

        return $this;
    }
690864
public function equals(self $number)
    {
        return (
            $this->isNegative === $number->isNegative
            && $this->coefficient === $number->getCoefficient()
            && $this->exponent === $number->getExponent()
        );
    }