Returns the digits representing the given decimal values.
@param int[] $decimals Decimal values to look up
@return array Array of digits that represent the given decimal values
@throws \InvalidArgumentException If any of the decimal values is invalid
356840
public function getDigits(array $decimals)
    {
        $digits = [];

        foreach ($decimals as $decimal) {
            $digits[] = $this->digits->getDigit($decimal);
        }

        return $digits;
    }
353870
protected function sortEntitiesByValueClass($entities)
    {
        $entitiesByValueClassByIds = [];
        foreach ($entities as $entity) {
            if (null === $entity) {
                continue;
            }
            if (!$entity instanceof DataInterface) {
                throw new \InvalidArgumentException(self::E_MSG);
            }
            $entitiesByValueClassByIds[$entity->getFamily()->getValueClass()][$entity->getId()] = $entity;
        }

        return $entitiesByValueClassByIds;
    }
810604
private function numberFormat($value, $decimals, $decimalPoint, $thousandSeperator)
    {
        if (is_null($decimals)){
            $decimals = is_null(config('cart.format.decimals')) ? 2 : config('cart.format.decimals');
        }

        if (is_null($decimalPoint)){
            $decimalPoint = is_null(config('cart.format.decimal_point')) ? '.' : config('cart.format.decimal_point');
        }

        if (is_null($thousandSeperator)){
            $thousandSeperator = is_null(config('cart.format.thousand_seperator')) ? ',' : config('cart.format.thousand_seperator');
        }

        return number_format($value, $decimals, $decimalPoint, $thousandSeperator);
    }
117282
public function number($number, $decimals = null)
    {
        return number_format(
            (float) $number,
            $decimals,
            $this->getSymbol(self::DECIMAL_MARK),
            $this->getSymbol(self::THOUSANDS_SEPARATOR)
        );
    }
1258889
public function price($decimals = null, $decimalPoint = null, $thousandSeperator = null)
    {
        return $this->numberFormat($this->price, $decimals, $decimalPoint, $thousandSeperator);
    }
139190
public function getStartExecutionTime($numberFormat = false, $decimals = 6)
    {
        if ( ! $numberFormat) {
            return $this->startExecutionTime;
        }

        return number_format($this->startExecutionTime, $decimals);
    }
335649
public function numberFormat($decimals, $decimalPoint, $thousandSeparator)
    {
        return $this->addRule(new FilterRule\NumberFormat($decimals, $decimalPoint, $thousandSeparator));
    }
932448
private function decimalPlacesCheck()
    {
        if (empty($this->decimalPlaces)) {
            return [
                CheckError::createObject(
                    [
                        'message' => sprintf("%s expects 'decimalPlaces' attribute to be set.", get_class($this)),
                        'hint' => null,
                        'context' => $this,
                        'id' => 'fields.E130',
                    ]
                ),
            ];
        }
        if (!is_numeric($this->decimalPlaces) || $this->decimalPlaces < 0) {
            return [
                CheckError::createObject(
                    [
                        'message' => sprintf(
                            "%s expects 'decimalPlaces' attribute to be a positive integer.",
                            static::class
                        ),
                        'hint' => null,
                        'context' => $this,
                        'id' => 'fields.E131',
                    ]
                ),
            ];
        }

        return [];
    }
1204987
private static function validateExpires($expires) : int
  {
    if (is_numeric($expires)) {
      return (int)$expires;
    }

    // Add intervals to current type
    if ($expires instanceof \DateInterval) {
      $now = new \DateTime('now');
      return (int)$now->add($expires)->format('U');
    }

    if ($expires instanceof \DateTimeInterface) {
      return (int)$expires->format('U');
    } 

    $expires = strtotime($expires);

    if (false === $expires || -1 === $expires) {
       throw new \InvalidArgumentException('The expiration time is not valid.');
    }

    return $expires;
  }
1203593
public function getAuthenticateData(array $registrations)
    {
        $sigs = array();
        $challenge = $this->createChallenge();
        foreach ($registrations as $reg) {
            if( !is_object( $reg ) ) {
                throw new \InvalidArgumentException('$registrations of getAuthenticateData() method only accepts array of object.');
            }
            /** @var Registration $reg */

            $sig = new SignRequest();
            $sig->appId = $this->appId;
            $sig->keyHandle = $reg->keyHandle;
            $sig->challenge = $challenge;
            $sigs[] = $sig;
        }
        return $sigs;
    }
932525
public static function decimal( $value, $decimals = 2 )
	{
		$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::DECIMAL);
		$nf->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
		return $nf->format($value);
	}
98162
protected function toMany(array $units, $decimals = null, $round = true)
    {
        $results = array();
        foreach ($units as $key) {
            $results[$key] = $this->to($key, $decimals, $round);
        }

        return $results;
    }
766011
public static function sizeFormat($bytes, $decimals = 0){
        $bytes = floatval($bytes);
        if ($bytes < 1024) {
            return number_format($bytes, $decimals, '.', '') . ' B';
        } elseif ($bytes < pow(1024, 2)) {
            return number_format($bytes / 1024, $decimals, '.', '') . ' KB';
        } elseif ($bytes < pow(1024, 3)) {
            return number_format($bytes / pow(1024, 2), $decimals, '.', '') . ' MB';
        } elseif ($bytes < pow(1024, 4)) {
            return number_format($bytes / pow(1024, 3), $decimals, '.', '') . ' GB';
        } elseif ($bytes < pow(1024, 5)) {
            return number_format($bytes / pow(1024, 4), $decimals, '.', '') . ' TB';
        } elseif ($bytes < pow(1024, 6)) {
            return number_format($bytes / pow(1024, 5), $decimals, '.', '') . ' PB';
        } else {
            return number_format($bytes / pow(1024, 5), $decimals, '.', '') . ' PB';
        }
    }
916190
public function get_max_decimals( $options ) {

		$length = (int) pods_v( static::$type . '_max_length', $options, 12, true );

		if ( $length < 1 || 64 < $length ) {
			$length = 64;
		}

		$decimals = (int) pods_v( static::$type . '_decimals', $options, 2 );

		if ( $decimals < 1 ) {
			$decimals = 0;
		} elseif ( 30 < $decimals ) {
			$decimals = 30;
		}

		if ( $length < $decimals ) {
			$decimals = $length;
		}

		return $decimals;
	}
161375
public function encode($numbers)
    {
        if (!is_array($numbers)) {
            $numbers = [$numbers];
        }
        if ($this->signed) {
            $numbers = Signed::encodeBlock($numbers);
        }
        $digits = [];
        $bits = $this->bits;
        $cBit = $this->cBit;
        foreach ($numbers as $number) {
            do {
                $digit = ($number % $this->cBit);
                $number >>= $bits;
                $continue = ($number > 0);
                if ($continue) {
                    $digit += $cBit;
                }
                $digits[] = $digit;
            } while ($continue);
        }
        return $digits;
    }
236917
public function format($decimals = 0, $decPoint = '.', $thousandsSep = ' ')
    {
        $decimals = max(0, (int) $decimals);
        $dec      = '';
        // do not mutate
        $number   = (new static($this))->round($decimals)->normalize();
        $sign     = $number->isPositive() ? '' : '-';
        if ($number->abs()->hasDecimals()) {
            list($number, $dec) = explode('.', (string) $number);
        }

        if ($decimals) {
            $dec = sprintf("%'0-" . $decimals . 's', $dec);
        }

        return $sign . preg_replace("/(?<=\d)(?=(\d{3})+(?!\d))/", $thousandsSep, $number) . ($decimals ? $decPoint . $dec : '');
    }
397203
public function numberFormat($number, int $decimals = 0): string
    {
        if (!isset($this->numberFormatter)) {
            $this->numberFormatter = new NumberFormatter($this->intuition->getLang(), NumberFormatter::DECIMAL);
        }
        $this->numberFormatter->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
        return $this->numberFormatter->format($number);
    }