@param int  $number
@param int  $after
@param bool $use_thousand_separator

@return string
763105
public static function numberToPrice(int $number = 0, int $after = 2, bool $use_thousand_separator = false): string
    {
        $number = str_replace(',', '.', $number);

        if (!preg_match('/^[.0-9]+$/', $number)) {
            return $number;
        }

        if ($use_thousand_separator) {
            return number_format($number, $after);
        }

        return number_format($number, $after, '.', '');
    }
1142080
public static function php_number_format($number)
    {

        preg_match('/[.,](\d+)$/', $number, $matches);

        $num_decimals = strlen($matches[1]);

        return preg_replace('/[.,]/', '', $number) / pow(10, $num_decimals);
    }
1180703
public function getOutlineNumber($separator='.', $includeRoot=true)
    {
        if($this->outlineNumbers === null)
        {
            $numbers = array(1);

            if(!$this->isRoot())
            {
                $ancestors = $this->getAncestors();
                $root = $ancestors[0];

                $rootDescendants = $root->getDescendants(count($ancestors));

                $siblingNumber = 1;
                $level = 1;
                $pathLevel = 1;
                $stack = array();
                foreach($rootDescendants as $wrapper)
                {
                    $parent = end($stack);
                    while($parent && $wrapper->getLeftValue() > $parent->getRightValue())
                    {
                        array_pop($stack);
                        $parent = end($stack);
                        $level--;
                    }

                    if($wrapper->getLeftValue() <= $this->getLeftValue() && $wrapper->getRightValue() >= $this->getRightValue())
                    {
                        // On path

                        if($wrapper->isEqualTo($this))
                        {
                            $numbers[] = $siblingNumber;
                            break;
                        }
                        else if($wrapper->isEqualTo($ancestors[$pathLevel]))
                        {
                            $numbers[] = $siblingNumber;
                            $siblingNumber = 1;
                            $pathLevel++;
                        }
                    }
                    else if($pathLevel == $level)
                    {
                        $siblingNumber++;
                    }

                    if($wrapper->hasChildren())
                    {
                        array_push($stack, $wrapper);
                        $level++;
                    }
                }
            }

            $this->outlineNumbers = $numbers;
        }

        if($includeRoot === false)
        {
            return implode(array_slice($this->outlineNumbers, 1), $separator);
        }

        return implode($this->outlineNumbers, $separator);
    }
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;
    }
671072
private static function localeNumber($number, int $decimal = 2): string
	{
		return Number::getNumber(self::prepareFloat($number), $decimal);
	}
135251
protected function resolveAfter($after)
    {
        $getAfter = $this->resolveMiddleware($after);

        return function (Request $request, Response $response, Application $app) use ($getAfter) {
            $callback = $getAfter($request);
            if (!is_callable($callback)) {
                return null;
            }

            return $callback($request, $response, $app);
        };
    }
438562
public function divide($number = null)
    {
        if ($number === null) {
            $this->internalSetOperationModeWithHistory('divide');
        } elseif ($number instanceof Closure) {
            $this->internalSetOperationModeWithHistory('divide');
            return $this->group($number);
        } else {
            $this->performOperationOnExpressionEngine('divide', $number);
        }

        return $this;
    }
309949
public static function numberFormat($number, $decimals = 0)
    {
        return is_numeric($number) ? number_format(
            $number,
            $decimals,
            __('lang_decimal_point'),
            __('lang_thousands_sep')
        ) : $number;
    }
1202525
public static function BigNumber($Number, $Format = '') {
      if (!is_numeric($Number))
         return $Number;
		
		$Negative = FALSE;
		$WorkingNumber = $Number;
		if ($Number < 0) {
			$Negative = TRUE;
			$WorkingNumber = $Number - ($Number * 2);
		}

      if ($WorkingNumber >= 1000000000) {
         $Number2 = $WorkingNumber / 1000000000;
         $Suffix = "B";
      } elseif ($WorkingNumber >= 1000000) {
         $Number2 = $WorkingNumber / 1000000;
         $Suffix = "M";
      } elseif ($WorkingNumber >= 1000) {
         $Number2 = $WorkingNumber / 1000;
         $Suffix = "K";
      } else
         $Number2 = $Number;
		
		if ($Negative)
			$Number2 = $Number2 - ($Number2 * 2);

      if (isset($Suffix)) {
         $Result = number_format($Number2, 1);
			if (substr($Result, -2) == '.0')
				$Result = substr($Result, 0, -2);
				
			$Result .= $Suffix;
      } else {
         $Result = $Number;
      }
      
      if ($Format == 'html')
         $Result = Wrap($Result, 'span', array('title' => number_format($Number)));
      
      return $Result;
   }
155930
public static function format($number, $decimals = 2, $decimalPoint = '.', $thousandSeparator = ',')
    {
        return number_format($number, $decimals, $decimalPoint, $thousandSeparator);
    }
1299154
public static function plural($number,$after){
		$cases = array (2, 0, 1, 1, 1, 2);
		return $after[ ($number%100>4 && $number%100<20)? 2: $cases[min($number%10, 5)] ];
		}
95762
public function format($number) {
    if ((float) $number != $number) {
      throw new \InvalidArgumentException('Number has no valid float value.');
    }
    $sign = (int) ($number < 0);

    // Split the number in major and minor units, and make sure there is a
    // minor unit at all.
    $number = explode('.', abs($number));
    $number += array(
      self::MINOR => '',
    );

    $digits = array(
      str_split($number[self::MAJOR]),
      strlen($number[self::MINOR]) ? str_split($number[self::MINOR]) : array(),
    );

    $symbols = $this->cloneNumberPatternSymbols($this->symbols[$sign]);
    $this->process($symbols[$sign][self::MAJOR], $digits[self::MAJOR]);
    // Integer formatting defaults from right to left, but minor units should
    // be formatted from left to right, so reverse all data and results.
    $symbols_minor = array_reverse($symbols[$sign][self::MINOR]);
    $this->process($symbols_minor, array_reverse($digits[self::MINOR]));
    foreach ($symbols[$sign][self::MINOR] as $symbol) {
      if (!is_null($symbol->replacement)) {
        $symbol->replacement = strrev($symbol->replacement);
      }
    }

    // Prepare the output string.
    $output = array(
      self::MAJOR => '',
      self::MINOR => '',
    );
    foreach ($symbols[$sign] as $fragment => $fragment_symbols) {
      $this->replacePlaceholders($fragment_symbols);
      foreach ($fragment_symbols as $symbol) {
        $output[$fragment] .= !is_null($symbol->replacement) ? $symbol->replacement : $symbol->symbol;
      }
    }

    return $output[self::MAJOR] . $this->getReplacement(self::SYMBOL_SPECIAL_DECIMAL_SEPARATOR) . $output[self::MINOR];
  }
1319061
public function formatStandardNumber($number, $decimals = null)
    {
        $lang = $this->request->getSession()->getLang();

        if ($decimals === null) {
            $decimals = $lang->getDecimals();
        }

        return number_format($number, $decimals, '.', '');
    }
165169
private function showDigitsGroup($number, $last = false)
    {
        $ret = '';

        $units = $number % 10;
        $tens = (int) ($number / 10) % 10;
        $hundreds = (int) ($number / 100) % 10;

        if ($hundreds) {
            if ($hundreds > 1) {
                $ret .= BelgianDictionary::$digits[$hundreds] . BelgianDictionary::$wordSeparator . BelgianDictionary::$miscNumbers[100];
                if ($last && !$units && !$tens) {
                    $ret .= BelgianDictionary::$pluralSuffix;
                }
            } else {
                $ret .= BelgianDictionary::$miscNumbers[100];
            }
            $ret .= BelgianDictionary::$wordSeparator;
        }

        if ($tens) {
            if ($tens === 1) {
                if ($units <= 6) {
                    $ret .= BelgianDictionary::$miscNumbers[10 + $units];
                } else {
                    $ret .= BelgianDictionary::$miscNumbers[10] . '-' . BelgianDictionary::$digits[$units];
                }
                $units = 0;
            } elseif ($tens === 8) {
                $ret .= BelgianDictionary::$digits[4] . BelgianDictionary::$dash . BelgianDictionary::$miscNumbers[20];
                $resto = $tens * 10 + $units - 80;
                if ($resto) {
                    $ret .= BelgianDictionary::$dash;
                    $ret .= $this->showDigitsGroup($resto);
                    $units = 0;
                } else {
                    $ret .= BelgianDictionary::$pluralSuffix;
                }
            } else {
                $ret .= BelgianDictionary::$miscNumbers[$tens * 10];
            }
        }

        if ($units) {
            if ($tens) {
                if ($units === 1) {
                    $ret .= BelgianDictionary::$wordSeparator . BelgianDictionary::$and . BelgianDictionary::$wordSeparator;
                } else {
                    $ret .= BelgianDictionary::$dash;
                }
            }
            $ret .= BelgianDictionary::$digits[$units];
        }

        return rtrim($ret, BelgianDictionary::$wordSeparator);
    }
1064662
public static function SplitIntoSegments($number)
	{
		$number_str = $number->GetStringValue();
		$segments = [];
		$NumberSegments = [];

		while (strlen($number_str) > 0)
		{
			if (strlen($number_str) < 3)
			{
				$segments[] = $number_str;

				break;
			}

			$segment = substr($number_str, -3);
			$number_str = substr($number_str, 0, strlen($number_str) - 3);

			$segments[] = $segment;
		}

		return array_reverse($segments);
	}
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;
    }
341375
public function getJID($number)
    {
        if (!stristr($number, '@')) {
            //check if group message
            if (stristr($number, '-')) {
                //to group
                $number .= '@'.Constants::WHATSAPP_GROUP_SERVER;
            } else {
                //to normal user
                $number .= '@'.Constants::WHATSAPP_SERVER;
            }
        }

        return $number;
    }