def METHOD_NAME(name, value, parameter):
    """Converts a parameter to the correct type
    Parameters
    ----------
    name: str
        The name of the received parameter
    value: str
        The value of the received parameter
    parameter: Parameter
        The parameter object
    Returns
    -------
    The converted parameter
    """
    try:
        # Try to cast the value to the correct type if int or float
        if parameter.type_ is int:
            new_value = parameter.type_(float(value))
        elif parameter.type_ is float:
            new_value = parameter.type_(value)
        elif parameter.type_ is bool:
            new_value = strtobool(value)
        else:
            new_value = value
    except ValueError:
        new_value = parameter.default
        console.print(
            f"[red]'{name}' format should be '{parameter.type_.__name__}' type[/red]",
            f"[red]and could not be converted. Setting default '{new_value}'.\n[/red]",
        )
    return new_value