Creates Modulo10 recursive check digit

@copyright As found on http://www.developers-guide.net/forums/5431,modulo10-rekursiv (thanks, dude!)
@param string $number Number to create recursive check digit off.
@return int Recursive check digit.
172345
protected function modulo10($number)
    {
        $next = 0;
        for ($i=0; $i < strlen($number); $i++) {
            $next = $this->moduloTable[($next + intval(substr($number, $i, 1))) % 10];
        }

        return (10 - $next) % 10;
    }
957766
public function inv($number, $modulus)
    {
        if ($this->coprime($number, $modulus) === false) {
            return '0';
        }

        $a = '1';
        $b = '0';
        $z = '0';
        $c = '0';

        list($modulus, $number) = array($this->bcNormalize($modulus), $this->bcNormalize($number));
        list($mod, $num)        = array($modulus, $number);

        try {

            do {
                list($z, $c)     = $this->modDiv($num, $mod);
                list($mod, $num) = array($z, $mod);

                $z = $this->subMul($a, $b, $c);

                list($a, $b) = array($b, $z);
            } while (bccomp($mod, '0') > 0);

            return $this->addMod($a, $modulus);

        } catch (\Exception $e) {
            throw $e;
        }
    }
265322
public static function formatSocialNumber($number){

		assert('is_integer($number)');

		if(!is_integer($number)) return $number;

		if($number > 10000000){

			$number = round($number / 1000000) . 'M';
		}
		elseif($number > 1000000){

			$number = round($number / 1000000, 1) . 'M';
		}
		elseif($number > 10000){

			$number = round($number / 1000) . 'K';
		}
		elseif($number > 1000){

			$number = round($number / 1000, 1) . 'K';
		}

		return $number;
	}
841876
static function parseMobileNumber($number) {
    // Extract numerics
    $numerics = static::extractNumerics($number);
    // Set country code
    $countryCode = '';
    // Get last 10 digits
    $short = static::right($numerics, 10, $countryCode);
    // Set carrier code
    $carriercode = '';
    // Get number
    $number = static::right($short, 7, $carrierCode);
    // Return
    return compact('countryCode', 'carrierCode', 'number');
  }
957395
public static function convert($number)
    {
        $number = preg_replace('/\,/i', '', $number);

        $number = preg_replace('/([^0-9\.\-])/i', '', $number);

        if (! is_numeric($number)) {
            return '0.00';
        }

        $isCents = (bool) preg_match('/^0.\d+$/', $number);

        return ($isCents ? '0' : null).number_format($number * 100., 0, '.', '');
    }
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;
    }
1248638
public function eq($number)
    {
        return (bool) (bccomp($this->number, static::validateInputNumber($number), $this->precision) === 0);
    }
1091428
private function precision($number)
        {
            $precision = 0;
            $pt = strpos($number, '.');

            if ($pt !== false) {
                $precision = -(strlen($number) - $pt - 1);
            }

            return pow(10, $precision) / 2;
        }
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;
    }
1042837
private function getDecimal(array $number)
    {
        if ($this->isStandardBase($this->source->getDigitList())) {
            return gmp_init(implode('', $this->source->canonizeDigits($number)), $this->source->getRadix());
        }

        $number = $this->source->getValues($number);
        $decimal = gmp_init('0');
        $count = count($number);
        $radix = gmp_init($this->source->getRadix());

        for ($i = 0; $i < $count; $i++) {
            $decimal = gmp_add($decimal, gmp_mul(gmp_init($number[$i]), gmp_pow($radix, $count - $i - 1)));
        }

        return $decimal;
    }
995818
public static function fromNumber($number)
    {
        if (is_float($number)) {
            return self::fromString(sprintf('%.14F', $number));
        }

        if (is_int($number)) {
            return new self($number);
        }

        if (is_string($number)) {
            return self::fromString($number);
        }

        throw new \InvalidArgumentException('Valid numeric value expected');
    }
567153
private function strConst($number) {
        static $lookup;
        if (!$lookup) {
            $lookup = array();
            $r = new ReflectionClass('HTML5_TreeBuilder');
            $consts = $r->getConstants();
            foreach ($consts as $const => $num) {
                if (!is_int($num)) continue;
                $lookup[$num] = $const;
            }
        }
        return $lookup[$number];
    }
1214291
public static function getDecimalPlaces($number) {
		$decimalPlaces = 0;
		while ($number > 1 && $number != 0) {
			$number /= 10;
			$decimalPlaces -= 1;
		}
		while ($number < 1 && $number != 0) {
			$number *= 10;
			$decimalPlaces += 1;
		}
		return $decimalPlaces;
	}
758333
public function randomMutable(int $number = null): self
    {
        $this->generatorToArray();

        if (\count($this->array, \COUNT_NORMAL) === 0) {
            return static::create(
                [],
                $this->iteratorClass,
                false
            );
        }

        if ($number === null) {
            /** @noinspection NonSecureArrayRandUsageInspection */
            $arrayRandValue = [$this->array[\array_rand($this->array)]];
            $this->array = $arrayRandValue;

            return $this;
        }

        /** @noinspection NonSecureShuffleUsageInspection */
        \shuffle($this->array);

        return $this->firstsMutable($number);
    }
1044321
private static function getNum125($number) {
		/** @var int $result */
		/** @var int $n100 */
		$n100 = $number % 100;
		/** @var int $n100 */
		$n10 = $number % 10;
		if (($n100 > 10) && ($n100 < 20)) {
			$result = self::NUMBER_FORM_5;
		}
		else if ($n10 === 1) {
			$result = self::NUMBER_FORM_1;
		}
		else if (($n10 >= 2) && ($n10 <= 4)) {
			$result = self::NUMBER_FORM_2;
		}
		else {
			$result = self::NUMBER_FORM_5;
		}
		return $result;
	}
290456
public static function ordinal($number) {
        $g11n = G11n::registry();

        if (!$g11n->isEnabled()) {
            return $number;
        }

        return static::cache([__METHOD__, $number], function() use ($number, $g11n) {
            $inflections = $g11n->current()->getInflectionRules();
            $number = (int) $number;

            if (!$inflections || empty($inflections['ordinal'])) {
                return $number;
            }

            $ordinal = $inflections['ordinal'];

            // Teens 11-13
            if (in_array(($number % 100), range(11, 13)) && isset($ordinal['default'])) {
                return str_replace('#', $number, $ordinal['default']);
            }

            // First, second, third
            $modNumber = $number % 10;

            foreach ($ordinal as $i => $format) {
                if (is_numeric($i) && $modNumber === $i) {
                    return str_replace('#', $number, $ordinal[$i]);
                }
            }

            // Fallback
            if (isset($ordinal['default'])) {
                return str_replace('#', $number, $ordinal['default']);
            }

            return $number;
        });
    }
736646
public function sizeFilter($number, $precision)
    {
        $mod = 1000;
        $index = count($this->suffixes);
        if ($number < ($mod ** $index)) {
            for ($i = 0; $number >= $mod; ++$i) {
                $number /= $mod;
            }
        } else {
            $number /= $mod ** ($index - 1);
            $i = ($index - 1);
        }
        $formatter = new NumberFormatter($this->getLocale(), NumberFormatter::PATTERN_DECIMAL);
        $formatter->setPattern($formatter->getPattern() . ' ' . $this->translator->trans($this->suffixes[$i]));
        $return = $formatter->format(round($number, $precision));

        return $return;
    }