yii\i18n\Formatter::normalizeNumericValue PHP Method

normalizeNumericValue() protected method

- everything empty will result in 0 - a numeric string will be casted to float - everything else will be returned if it is numeric, otherwise an exception is thrown.
protected normalizeNumericValue ( mixed $value ) : float | integer
$value mixed the input value
return float | integer the normalized number value
    protected function normalizeNumericValue($value)
    {
        if (empty($value)) {
            return 0;
        }
        if (is_string($value) && is_numeric($value)) {
            $value = (double) $value;
        }
        if (!is_numeric($value)) {
            throw new InvalidParamException("'{$value}' is not a numeric value.");
        }
        return $value;
    }