Rounds a value using the PHP round() function.

@param float $value
@param string|null $currency
@return float
341087
public function round($value, $currency = null)
    {
        return round($value, $this->precision, $this->mode);
    }
275853
private function getValue(array $values, string $currency = null): string
    {
        $currency = !is_null($currency) ? strtolower($currency) : $this->provider->get();

        $values = array_change_key_case($values);

        return $values[$currency];
    }
1284150
private function roundValue( $value, $precision )
	{
		if ( $precision == INF ) return $value;
		return round( $value, \XBRL_Instance::inferDecimals( $value, $precision ) );
	}
1337592
public function round($amount, array $currency)
    {
        if (empty($currency['rounding_step'])) {
            return round($amount, $currency['decimals']);
        }

        $modifier = 1 / $currency['rounding_step'];
        return round($amount * $modifier) / $modifier;
    }
661633
public static function formatAsMoney($value, $currencySymbol = "&pound;", $roundToInteger = false) {
        if (is_numeric($value))
            return $currencySymbol . number_format($value, $roundToInteger ? 0 : 2, ".", "");
        else
            return null;
    }
1088587
public static final Double parseCurrency(Number value)
   {
      return (value == null ? null : NumberHelper.getDouble(value.doubleValue() / 100));
   }
1206244
public static function float($value=0, bool $flatten=false) {
		ref\cast::float($value, $flatten);
		return $value;
	}
1124769
public static function float($value){

		$value = static::_nullValue($value);

		if($value !== null){

			// Avoid decimal separator nonsense
			$value = str_replace(',', '.', $value);
			$value = (float) $value;
		}

		return $value;
	}
556740
protected function isValidCurrency(string $value): void
    {
        $allowedCurrency = $this->getAllowedCurrency();

        $regex = '/^' . implode('|', $allowedCurrency) . '$/';
        if (!preg_match($regex, $value)) {
            throw new InvalidCurrencyException(sprintf(
                '%s is not a valid currency. Currency must be in ISO-4217-3 format.',
                $value
            ));
        }
    }
785375
public function formatCurrency($value, $currency, $precision=2)
    {
        $newValue = trim($value, " \0\x0B$currency");
        if (!is_numeric($newValue)) {
            return $value;
        }

        $pattern = $this->getPattern($value, 'Intl_NumberFormatCurrency');

        if ($newValue == round($newValue)) {
            // if no fraction digits available, don't show any
            $value = $this->formatNumberWithPattern($pattern, $newValue, 0, 0);
        } else {
            // show given count of fraction digits otherwise
            $value = $this->formatNumberWithPattern($pattern, $newValue, $precision, $precision);
        }

        return str_replace('¤', $currency, $value);
    }
469626
public static RoundedMoney of(Number number, CurrencyUnit currency, MonetaryContext monetaryContext) {
        return new RoundedMoney(number, currency,
                DEFAULT_MONETARY_CONTEXT.toBuilder().importContext(monetaryContext).build(), null);
    }
1104160
public static function float($value, int $precision = 2) :float {
		if(strrpos($value, '.')) {
			$value = str_replace(',', '' , $value);
		}
		elseif(strrpos($value, ',')) {
			$value = str_replace('.', '' , $value);
		} 
		return(floatval(
			round(preg_replace('/[^0-9.\-]/', '', str_replace(',', '.' , $value)), $precision)
		));
	}
932326
public function actionCurrency($value, $currency = null, $options = [], $textOptions = [])
    {
        return Yii::$app->formatter->asCurrency($value, $currency, $options, $textOptions);
    }
810843
public function getValue()
    {
        return round($this->amount / $this->currency->getSubunit(), $this->currency->getPrecision());
    }
1257
public static function convertAngleValue($value)
    {
        if($value !== null && strpos($value, 'deg') !== false)
        {
            $value = (float) $value;
            $value = deg2rad($value);
        }
        
        return $value !== null ? ((float) $value) : null;
    }
1066552
private function format_float($value) {
        if (is_numeric($value)) {
            if ($value > 0) {
                $decimals = strlen($value) - strlen(floor($value)) - 1;
            } else {
                $decimals = strlen($value) - strlen(ceil($value)) - 1;
            }
            $value = format_float($value, $decimals);
        }
        return $value;
    }
747664
public static function currency( $value, $decimals = 2, $currencyCode = null )
	{
		$app = Application::instance();
		$currencyCode = $currencyCode ?: $app->getConfig('app.settings.currency');

		$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::CURRENCY);
		$nf->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
		return $nf->formatCurrency($value, $currencyCode);
	}