code: def string(self, units: typing.Optional[str] = None) -> str:
          
          if not units:
              _units: str = self._units
          else:
              if not units.upper() in CustomPressure.legal_units:
                  raise UnitsError("unrecognized pressure unit: '" + units + "'")
              _units = units.upper()
          val = self.value(units)
          if _units == "MB":
              return "%.0f mb" % val
          if _units == "HPA":
              return "%.0f hPa" % val
          if _units == "IN":
              return "%.2f inches" % val
          if _units == "MM":
              return "%.0f mmHg" % val
  
          raise ValueError(_units)
docs: Return a string representation of the pressure, using the given units.