def METHOD_NAME(self, value: Any) -> int | float:
    """Convert a value to an int or float considering the precision.
    If the value is not convertable an exception will be raised."""
    if isinstance(value, str):
        value = value.replace(",", ".", 1)
    if self.precision:
        return float(value)
    else:
        # First convert to float then to int to support "42.5" (str)
        return int(float(value))