@param float $float
@param string|null $locale

@throws PriceFormatterException

@return string
174743
public function formatToWholeNumbers(
        $float,
        $locale = null
    ) {
        if (is_null($locale)) {
            $locale = $this->defaultLocale;
        }

        $formatter = $this->retrieveDecimalFormatter($locale);

        return $formatter->format($float);
    }
1214735
public function currencyFormat($locale = 'id_ID', $currency = 'IDR', $addSpace = true)
    {
        return currency_format($this->amount, $locale, $currency, $addSpace);
    }
170301
public function getTotalRecurringTaxesFormatted($locale = null)
    {
        return $this->priceFormatter->format((float)$this->getTotalRecurringTaxes(), null, $locale);
    }
1258117
protected function getFormatter($locale) {
		if (! isset($this->formatters[$locale])) {
			$this->formatters[$locale] = new NumberFormatter($locale, NumberFormatter::DECIMAL);
		}
		
		return $this->formatters[$locale];
	}
493223
public function getSymbol($locale = null): string
    {
        if (null === $locale) {
            $locale = Yii::$app->formatter->locale;
        }
        $fmt = new NumberFormatter($locale . "@currency={$this->code}", NumberFormatter::CURRENCY);
        $symbol = $fmt->getSymbol(NumberFormatter::CURRENCY_SYMBOL);

        return $symbol;
    }
626082
public static function format($value, $precision = null, $locale = null)
    {
        if ($precision === null) {
            $precision = self::$default_precision;
        }
        if ($locale) {
            $currentLocale = self::$_locale;
            self::$_locale = $locale;
        }
        if (is_array($value)) {
            foreach ($value as &$val) {
                $val = self::format($val, $precision);
            }
            return $value;
        }

        if (self::$_locale !== i18n::get_locale()) {
            self::initVariables();
        }
        if (self::$_decimals === null) {
            self::initVariables();
        }

        $rawValue = self::unformat($value);

        $formattedValue = number_format(
            $rawValue,
            $precision,
            self::$_decimals,
            self::$_thousands
        );

        if ($locale) {
            self::$_locale = $currentLocale;
        }

        return $formattedValue;
    }
1233211
public function getTotalNetPriceFormatted($locale = null)
    {
        $formatter = $this->getFormatter($locale);

        return $formatter->format((float)$this->entity->getTotalNetPrice());
    }
826476
protected function getLocale($locale)
    {
        $result = null;
        if ($locale instanceof LocaleEntity) {
            $result = $locale;
        } elseif (is_string($locale) && $locale !== '') {
            $result = $this->app->make(LocaleRepository::class)->findApproved($locale);
        }

        return $result;
    }
647020
public function format(
        $price,
        $digits = null,
        $locale = null,
        $currency = null,
        $currencyPosition = self::CURRENCY_LOCATION_NONE
    ) {
        if (is_null($locale)) {
            $locale = $this->defaultLocale;
        }

        if (is_null($digits)) {
            $digits = $this->defaultDigits;
        }

        $formatter = $this->getFormatter($locale, $digits);
        $formattedPrice = $formatter->format($price);

        if ($currencyPosition != self::CURRENCY_LOCATION_NONE && is_null($currency)) {
            throw new PriceFormatterException('currency must be set, if location is set');
        }

        switch ($currencyPosition) {
            case self::CURRENCY_LOCATION_PREFIX:
                $formattedPrice = $currency . ' ' . $formattedPrice;
                break;
            case self::CURRENCY_LOCATION_SUFFIX:
                $formattedPrice = $formattedPrice . ' ' . $currency;
                break;
        }

        return $formattedPrice;
    }
1303279
public function localizeMoneyFromArrFilter(array $money, string $locale = null): string
    {
        if (isset($money['humanAmount'], $money['baseAmount'])) {
            unset($money['humanAmount']);
        }

        $formattingMoney = new Money($money);

        return $this->localizeMoneyFilter($formattingMoney, $locale);
    }
56561
public function formatByIntlLocalizedDecimal(
        $locale = null,
        Currencies $currencies = null,
        $style = NumberFormatter::CURRENCY
    ) {
        $numberFormatter = new NumberFormatter($locale ?: static::getLocale(), $style);
        $formatter = new IntlLocalizedDecimalFormatter($numberFormatter, $currencies ?: static::getCurrencies());

        return $this->formatByFormatter($formatter);
    }
836061
public static function formatLocale($locale)
    {
        if (\is_string($locale)) {
            $locale = strtolower($locale);
            $locale = str_replace('-', '_', $locale);
        }

        return $locale;
    }
144083
public function locale($locale = null)
    {
        // Set the locale if a valid local is passed
        if ($locale
            && ($locales = Config::get('decoy.site.locales'))
            && is_array($locales)
            && isset($locales[$locale])) {
            return Session::put('locale', $locale);
        }

        // Return the current locale or default to first one.  Store it in a local var
        // so that multiple calls don't have to do any complicated work.  We're assuming
        // the locale won't change within a single request.
        if (!$this->locale) {
            $this->locale = Session::get('locale', $this->defaultLocale());
        }

        return $this->locale;
    }
432084
public function getFormattedPrice($price, $symbol = 'EUR', $locale = 'de')
    {
        return $this->priceFormatter->format(
            (float) $price,
            null,
            $locale,
            $symbol,
            PriceFormatter::CURRENCY_LOCATION_SUFFIX
        );
    }
975322
protected function getNumberFormat($locale)
    {
        if (!isset($this->numberFormats[$locale])) {
            $this->numberFormats[$locale] = $this->numberFormatRepository->get($locale);
        }

        return $this->numberFormats[$locale];
    }
434923
public static function fromLocale(string $locale): LocaleFormatter
    {
        $formatter = new NumberFormatter((string) $locale, NumberFormatter::CURRENCY);

        return new self($formatter);
    }
348157
public function getDeliveryCostFormatted($locale = null)
    {
        $formatter = $this->getFormatter($locale);

        return $formatter->format((float)$this->entity->getDeliveryCost());
    }