def string(self, units: typing.Optional[str] = None) -> str:
if not units:<EOL><INDENT>_units: str = self._units<EOL><DEDENT>else:<EOL><INDENT>if not units.upper() in CustomPressure.legal_units:<EOL><INDENT>raise UnitsError("<STR_LIT>" + units + "<STR_LIT:'>")<EOL><DEDENT>_units = units.upper()<EOL><DEDENT>val = self.value(units)<EOL>if _units == "<STR_LIT>":<EOL><INDENT>return "<STR_LIT>" % val<EOL><DEDENT>if _units == "<STR_LIT>":<EOL><INDENT>return "<STR_LIT>" % val<EOL><DEDENT>if _units == "<STR_LIT>":<EOL><INDENT>return "<STR_LIT>" % val<EOL><DEDENT>if _units == "<STR_LIT>":<EOL><INDENT>return "<STR_LIT>" % val<EOL><DEDENT>raise ValueError(_units)<EOL>
Return a string representation of the pressure, using the given units.