core/helpers/StringHelper.php
public static function typeCastNumeric($value)
    {
        if (!self::isFloat($value)) {
            return $value;
        }
        
        if (intval($value) == $value) {
            return (int) $value;
        }
        
        return (float) $value;
    }
public static function typeCastNumeric($value)
    {
        if (!self::isFloat($value)) {
            return $value;
        }
        
        if (intval($value) == $value) {
            return (int) $value;
        }
        
        return (float) $value;
    }
public static function typeCastNumeric ( $ value ) { if ( ! self :: isFloat ( $ value ) ) { return $ value ; } if ( intval ( $ value ) == $ value ) { return ( int ) $ value ; } return ( float ) $ value ; }
TypeCast a numeric value to float or integer.

If the given value is not a numeric or float value it will be returned as it is. In order to find out whether its float
or not use {{luya\helpers\StringHelper::isFloat()}}.

@param mixed $value The given value to parse.
@return mixed Returns the original value if not numeric or integer, float casted value.
TypeCast a numeric value to float or integer .