class_docstr: **Bases:** QtWidgets.QAbstractSpinBox
  
  Extension of QSpinBox widget for selection of a numerical value.     
  Adds many extra features:
  
    * SI prefix notation (eg, automatically display "300 mV" instead of "0.003 V")
    * Float values with linear and decimal stepping (1-9, 10-90, 100-900, etc.)
    * Option for unbounded values
    * Delayed signals (allows multiple rapid changes with only one change signal)
    * Customizable text formatting
  
  =============================  ==============================================
  **Signals:**
  valueChanged(value)            Same as QSpinBox; emitted every time the value 
                                 has changed.
  sigValueChanged(self)          Emitted when value has changed, but also combines
                                 multiple rapid changes into one signal (eg, 
                                 when rolling the mouse wheel).
  sigValueChanging(self, value)  Emitted immediately for all value changes.
  =============================  ==============================================
class_docstr_tok: ["*","*","Bases",":","*","*","QtWidgets.QAbstractSpinBox","Extension","of","QSpinBox","widget","for","selection","of","a","numerical","value",".","Adds","many","extra","features",":","*","SI","prefix","notation","(","eg",",","automatically","display","``","300","mV","''","instead","of","``","0.003","V","''",")","*","Float","values","with","linear","and","decimal","stepping","(","1-9",",","10-90",",","100-900",",","etc",".",")","*","Option","for","unbounded","values","*","Delayed","signals","(","allows","multiple","rapid","changes","with","only","one","change","signal",")","*","Customizable","text","formatting","=============================","==============================================","*","*","Signals",":","*","*","valueChanged","(","value",")","Same","as","QSpinBox",";","emitted","every","time","the","value","has","changed",".","sigValueChanged","(","self",")","Emitted","when","value","has","changed",",","but","also","combines","multiple","rapid","changes","into","one","signal","(","eg",",","when","rolling","the","mouse","wheel",")",".","sigValueChanging","(","self",",","value",")","Emitted","immediately","for","all","value","changes",".","=============================","=============================================="]
code: def formatText(self, prev=None):
      # get the number of decimal places to print
      decimals = self.opts["decimals"]
      suffix = self.opts["suffix"]
      prefix = self.opts["prefix"]
  
      # format the string
      val = self.value()
      if self.opts["siPrefix"] is True:
          # SI prefix was requested, so scale the value accordingly
  
          if self.val == 0 and prev is not None:
              # special case: if it's zero use the previous prefix
              (s, p) = fn.siScale(prev)
          else:
              (s, p) = fn.siScale(val)
          parts = {
              "value": val,
              "suffix": suffix,
              "decimals": decimals,
              "siPrefix": p,
              "scaledValue": s * val,
              "prefix": prefix,
          }
  
      else:
          # no SI prefix /suffix requested; scale is 1
          parts = {
              "value": val,
              "suffix": suffix,
              "decimals": decimals,
              "siPrefix": "",
              "scaledValue": val,
              "prefix": prefix,
          }
  
      parts["prefixGap"] = "" if parts["prefix"] == "" else " "
      parts["suffixGap"] = (
          ""
          if (parts["suffix"] == "" and parts["siPrefix"] == "")
          else " "
      )
  
      return self.opts["format"].format(**parts)
  
imports: import decimal
  import re
  from math import isinf, isnan
  from ..None import functions
  from ..Qt import QtCore, QtGui, QtWidgets
  from ..SignalProxy import SignalProxy
label_desc: Use image node_id 25 for calling the SpinBox obj's underlying member method code with example usage: obj.formatText(prev) and returns: self