code: def to_number(result_type, value, default=None, minimum=None, maximum=None):
      
      try:
          return capped(result_type(value), minimum, maximum)
  
      except (TypeError, ValueError):
          return default
docs: Cast `value` to numeric `result_type` if possible
  
      Args:
          result_type (type): Numerical type to convert to (one of: int, float, ...)
          value (str | unicode): Value to convert
          default (result_type.__class__ | None): Default to use `value` can't be turned into an int
          minimum (result_type.__class__ | None): If specified, result can't be below this minimum
          maximum (result_type.__class__ | None): If specified, result can't be above this maximum
  
      Returns:
          Corresponding numeric value