def char_to_number(value: str, required_type: str) -> str:
    """Converts the string representation of a number (int or float) to a number

    Args:
        value (str): String representation of a number
        required_type (str): Output type desired (bigint or double)

    Raises:
        Exception: The conversion to a python integer (using int built in method) failed
        Exception: The conversion to a python float (using float built in method) failed
        NotImplementedError: required_type was neither bigint nor double

    Returns:
        str: Numerical representation of the input string
    """
    value = value.strip("'").strip('"')  # Remove potential character markers
    if required_type == "bigint":
        try:
            assert f"{int(value)}" == value  # Make sure the str representation does not change
            return value
        except (TypeError, AssertionError, ValueError):
            msg = (
                f"A 'bigint' type is expected by Presto for this function, but {value} "
                "was provided which either cannot be casted or does not seem to represent an integer."
            )
            raise Exception(msg)
    elif required_type == "double":
        try:
            assert f"{float(value)}" == value
            return value
        except (TypeError, AssertionError, ValueError):
            msg = (
                f"A 'double' type is expected by Presto for this function, but {value} "
                "was provided which either cannot be casted or does not seem to represent a float."
            )
            raise Exception(msg)
    else:
        raise NotImplementedError