def convert_float(data):
    """
    Convert string to float if possible.

    Args:
        data (str or float): Input data that might be a string or float.

    Returns:
        float: The input data converted to a float.
    """
    try:
        return float(data)
    except ValueError:
        return None