Price filter

@param int    $number
@param bool   $applyOtherPercentageCharge
@param bool   $applyVat
@param bool   $round
@param int    $decimals
@param string $decPoint
@param string $thousandsSep

@return string
494091
public function pricesFilter($number, $type)
    {
        //€ = 0
        //% = 1
        // apply format
        $price = number_format($number, 2, ',', '.');

        // remove decimals when they are ,00
        if ('00' === substr($price, -2)) {
            $price = substr($price, 0, -3);
        }

        if($type){
            $price = $price.' %';
        }else{
            $price = $price.' '.$this->container->getParameter('ecommerce.currency_symbol');
        }
        
        

        return $price;
    }
782530
public static function number($number, $decimals = 0)
    {
        $l = self::getLocale();
        return number_format($number, $decimals, $l->decimalPoint, $l->thousandsSep);
    }
146290
public function calculate(float $percentage, PriceCollection $prices, SalesChannelContext $context): CalculatedPrice
    {
        $price = $prices->sum();

        $discount = $this->rounding->round(
            $price->getTotalPrice() / 100 * $percentage,
            $context->getContext()->getCurrencyPrecision()
        );

        $rules = $this->percentageTaxRuleBuilder->buildRules($price);

        $definition = new QuantityPriceDefinition($discount, $rules, $context->getContext()->getCurrencyPrecision(), 1, true);

        return $this->priceCalculator->calculate($definition, $context);
    }
843187
public function taxTotal($decimals = null, $decimalPoint = null, $thousandSeperator = null)
    {
        return $this->numberFormat($this->taxTotal, $decimals, $decimalPoint, $thousandSeperator);
    }
300674
public function total($decimals = null, $decimalPoint = null, $thousandSeperator = null)
    {
        return $this->numberFormat($this->total, $decimals, $decimalPoint, $thousandSeperator);
    }
218344
public function out($decimals = 2, $decPoint = '.', $thousandSep = ',')
    {
        return $this->format($decimals, $decPoint, $thousandSep) . ' ' . $this->unit;
    }
192467
public function modulusFilter($number, $divider, $items = null)
    {
        if (\is_string($number)) {
            $number = strlen($number);
        }

        $remainder = $number % $divider;

        if (\is_array($items)) {
            return $items[$remainder] ?? $items[0];
        }

        return $remainder;
    }
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);
    }
459165
public function formatAmount(Money $money, $decPoint = ',', $thousandsSep = ' ')
    {
        $amount = $this->asFloat($money);
        $amount = number_format($amount, $this->decimals, $decPoint, $thousandsSep);

        return $amount;
    }
87248
public function filterByAmount($amount)
    {
        $amount = intval($amount);
        $filteredArr = array();
        foreach ($this->_paymentMethodsArrayFiltered as $paymentMethod) {
            $continue = true;
            foreach ($paymentMethod["Issuers"] as $issuer) {
                foreach ($issuer["Countries"] as $country) {
                    if ($amount >= intval($country["MinimumAmount"]) &&
                            $amount <= intval($country["MaximumAmount"])) {
                        array_push($filteredArr, $paymentMethod);
                        $continue = false;
                    }
                    if (!$continue)
                        break;
                }
                if (!$continue)
                    break;
            }
        }
        $this->_paymentMethodsArrayFiltered = $filteredArr;
        return $this;
    }
394607
public function subtotal($decimals = null, $decimalPoint = null, $thousandSeperator = null)
    {
        $content = $this->getContent();

        $subTotal = $content->reduce(function ($subTotal, CartItem $cartItem) {
            return $subTotal + ($cartItem->qty * $cartItem->price);
        }, 0);

        return $this->numberFormat($subTotal, $decimals, $decimalPoint, $thousandSeperator);
    }
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, '.', '');
    }
102615
public function setNumberFormat($decimals = NULL, $decPoint = NULL, $thousandsSep = NULL)
    {
        if ($decimals !== NULL) {
            $this->numberFormat[self::NUMBER_FORMAT_DECIMALS] = (int) $decimals;
        }

        if ($decPoint !== NULL) {
            $this->numberFormat[self::NUMBER_FORMAT_DECIMAL_POINT] = $decPoint;
        }

        if ($thousandsSep !== NULL) {
            $this->numberFormat[self::NUMBER_FORMAT_THOUSANDS_SEPARATOR] = $thousandsSep;
        }

        return $this;
    }
1307920
public function money($amount, $decimals = 2, $sourceCurrency = null)
    {
        return str_replace(
            ['{number}', '{currency}'],
            [$this->number($decimals), $this->currency()],
            $this->get('money')['format']
        );
    }
3357
public function makeBackendFilterChargeAmount($amount)
    {
        $defMin = $this['limits']['charge_amount']['min'];
        $defMax = $this['limits']['charge_amount']['max'];
        return function ($backend) use ($amount, $defMin, $defMax) {
            // temporary hack for now to correct min value for instalments to 500000
            if ($backend->type == 'installment') {
                $min = 500000;
            } else {
                $min = empty($backend->amount['min']) ? $defMin : $backend->amount['min'];
            }
            $max = empty($backend->amount['max']) ? $defMax : $backend->amount['max'];
            return $amount >= $min && $amount <= $max;
        };
    }
651454
public function format($amount, $currency_code, $decimal = true, $full = true)
    {
        $currency = $this->currency->get($currency_code);

        if (empty($currency)) {
            return 'n/a';
        }

        if ($decimal) {
            $amount = $this->decimal($amount, $currency_code);
        }

        // Pass the amount to the currency template as %price variable
        $currency['price'] = $this->formatNumber($amount, $currency);

        if ($full) {
            return $this->formatTemplate($amount, $currency);
        }

        return $amount < 0 ? '-' . $currency['price'] : $currency['price'];
    }