@param $price

@return float
966796
private function priceAdjuster($price) {
        // min,max, value
        $price_ranges = [
            [01, 29, 29],
            [30, 49, 49],
            [50, 79, 79],
            [80, 99, 99],
            [00, 00, 99],
        ];

        list($whole, $decimal) = explode('.', $price);

        foreach ($price_ranges as &$value) {
            if($decimal >= $value[0] && $decimal <= $value[1]) {
                $decimal = $value[2];
                break;
            }
        }

        $price = $whole.'.'.$decimal;

        return floatval($price);
    }
1370889
public function formatPrice($price, $currency, $locale = null)
    {
        return $this->priceManager->getFormattedPrice($price, $currency, $locale);
    }
141626
public function getX() : ?float 
    {
        if ( ! $this->hasX()) {
            $this->setX($this->getDefaultX());
        }
        return $this->x;
    }
498023
public static function parseFloat($value)
    {
        $returnValue = (float) 0.0;

        $returnValue = str_replace(',', '.', $value);
        $returnValue = preg_replace('/[^\-\d.]/', '', $returnValue);

        return (float) $returnValue;
    }
865593
public static function floatalize($value)
    {
        $value = strtoupper($value);
        if (strpos($value, 'E') === false) {
            return $value;
        }

        $number = substr($value, 0, strpos($value, 'E'));
        if (strpos($number, '.') !== false) {
            $post   = strlen(substr($number, strpos($number, '.') + 1));
            $mantis = substr($value, strpos($value, 'E') + 1);
            if ($mantis < 0) {
                $post += abs((int) $mantis);
            }

            $value = number_format($value, $post, '.', '');
        } else {
            $value = number_format($value, 0, '.', '');
        }

        return $value;
    }
108628
public function calculate(PriceRule $priceRule, float $price, array $options = [])
    {
        $payload = $priceRule->payload;

        $options = (object) $options;

        $parser = new StdMathParser();

        if (!isset($payload->expression)) {
            throw new Exceptions\PriceRuleWrongPayloadException('Missing expression in payload');
        }

        if (!isset($options->vars)) {
            throw new Exceptions\PriceRuleWrongOptionsException('Missing vars in options');
        }

        $ast = $parser->parse($payload->expression);
        $evaluator = new Evaluator();
        $evaluator->setVariables(array_merge(['x' => $price], $options->vars));

        return floatval($ast->accept($evaluator));
    }
1202870
public static function toFloat($value)
    {
        if (!static::is($value)) {
            throw new \InvalidArgumentException(
                "The \$value parameter must be numeric (or string representing a big number)."
            );
        }

        if (is_int($value) || is_float($value)) {
            return (float)$value;
        } else {
            return ((Str::contains($value, '.')) ? $value : $value . '.0');
        }
    }
1185341
public static function makePriceFromDB($price)
    {

        $price_element = explode('.', $price);

        $cent = $price_element[1];

        $cent = str_pad($cent, '0', STR_PAD_LEFT);

        return ',' . $price_element[0] . $cent;
    }
307272
public function getRate() : ?float 
    {
        if ( ! $this->hasRate()) {
            $this->setRate($this->getDefaultRate());
        }
        return $this->rate;
    }
96823
public function getFormattedPrice($price, $symbol = 'EUR', $locale = null)
    {
        $location = PriceFormatter::CURRENCY_LOCATION_NONE;
        if (!empty($symbol)) {
            $location = PriceFormatter::CURRENCY_LOCATION_SUFFIX;
        }

        return $this->priceFormatter->format(
            (float) $price,
            null,
            $locale,
            $symbol,
            $location
        );
    }
681215
public function getPriceAttribute($val)
    {
        $currentCurrencyCode = Session::get('currency_code');

        if (null === $currentCurrencyCode) {
            return $val;
        }

        $siteCurrency = App::get(SiteCurrencyInterface::class);
        $model = $siteCurrency->findByCode($currentCurrencyCode);

        return $val * $model->conversion_rate;
    }
670390
public function convertPrice(float $price, $baseCurrency = null, $targetCurrency = null, $quantity = 1) : string
    {
        return $this->helper->convert($price, $baseCurrency, $targetCurrency, $quantity);
    }
797882
protected function checkPriceFormat($price)
    {
        if ($price === '0') {
            return;
        }
        $converted = (float)$price;
        if ($converted == 0) {
            throw new \Bitpay\Client\ArgumentException("Price must be formatted as a float ". $converted);
        }
    }
1289013
public function float($value)
    {
        if ($this->notBeEmpty($value)) {
            if (is_float($value)) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
122960
public function toFloat($num)
	{
		$dotPos = strrpos($num, '.');
		$commaPos = strrpos($num, ',');
		$sep = (($dotPos > $commaPos) && $dotPos) ? $dotPos : ((($commaPos > $dotPos) && $commaPos) ? $commaPos : false);

		if (!$sep) {
			return floatval(preg_replace('/[^0-9]/', '', $num));
		}

		return floatval(
			preg_replace('/[^0-9]/', '', substr($num, 0, $sep)) . '.' .
			preg_replace('/[^0-9]/', '', substr($num, $sep+1, strlen($num)))
		);
	}
1258889
public function price($decimals = null, $decimalPoint = null, $thousandSeperator = null)
    {
        return $this->numberFormat($this->price, $decimals, $decimalPoint, $thousandSeperator);
    }
438103
public function ceil($scale = 0): Decimal
    {
        if ($scale >= $this->scale) {
            return $this;
        }

        if ($this->isNegative()) {
            return self::fromString(\bcadd($this->value, '0', $scale));
        }

        return $this->innerTruncate($scale);
    }