Add a few minor notes to docs on suffix/siPrefix

This commit is contained in:
Kenneth Lyons 2021-02-03 17:27:41 -08:00
parent 0e90e70e2a
commit 15bdd89293
2 changed files with 6 additions and 3 deletions

View File

@ -139,7 +139,8 @@ def siParse(s, regex=FLOAT_REGEX, suffix=None):
Suffix to check for in ``s``. The default (None) indicates there may or
may not be a suffix contained in the string and it is returned if
found. An empty string ``""`` is handled differently: if the string
contains a suffix, it is discarded.
contains a suffix, it is discarded. This enables interpreting
characters following the numerical value as an SI prefix.
"""
s = asUnicode(s)
s = s.strip()

View File

@ -132,8 +132,10 @@ class SpinBox(QtGui.QAbstractSpinBox):
siPrefix (bool) If True, then an SI prefix is automatically prepended
to the units and the value is scaled accordingly. For example,
if value=0.003 and suffix='V', then the SpinBox will display
"300 mV" (but a call to SpinBox.value will still return 0.003). Default
is False.
"300 mV" (but a call to SpinBox.value will still return 0.003). In case
the value represents a dimensionless quantity that might span many
orders of magnitude, such as a Reynold's number, an SI
prefix is allowed with no suffix. Default is False.
step (float) The size of a single step. This is used when clicking the up/
down arrows, when rolling the mouse wheel, or when pressing
keyboard arrows while the widget has keyboard focus. Note that