MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / _round_value

Method _round_value

pyxrf/gui_module/useful_widgets.py:646–650  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

644 return f"{value:.8g}"
645
646 def _round_value(self, value):
647 # Compute rounded value based on formatting used in the line edit boxes
648 # This rounding is needed to properly set the validators
649 s = self._format_value(value) if not isinstance(value, str) else value
650 return self._convert_type(s)
651
652 def _check_value_type(self, value_type):
653 if value_type not in ("float", "int"):

Callers 1

_adjust_validatorsMethod · 0.95

Calls 2

_format_valueMethod · 0.95
_convert_typeMethod · 0.95

Tested by

no test coverage detected