code: def _twoByteStringToNum(bytestring, numberOfDecimals=0, signed=False):
      
      _checkString(bytestring, minlength=2, maxlength=2, description='bytestring')
      _checkInt(numberOfDecimals, minvalue=0, description='number of decimals')
      _checkBool(signed, description='signed parameter')
  
      formatcode = '>'  # Big-endian
      if signed:
          formatcode += 'h'  # (Signed) short (2 bytes)
      else:
          formatcode += 'H'  # Unsigned short (2 bytes)
  
      fullregister = _unpack(formatcode, bytestring)
  
      if numberOfDecimals == 0:
          return fullregister
      divisor = 10 ** numberOfDecimals
      return fullregister / float(divisor)
docs: Convert a two-byte string to a numerical value, possibly scaling it.
  
      Args:
          * bytestring (str): A string of length 2.
          * numberOfDecimals (int): The number of decimals. Defaults to 0.
          * signed (bol): Whether large positive values should be interpreted as negative values.
  
      Returns:
          The numerical value (int or float) calculated from the ``bytestring``.
  
      Raises:
          TypeError, ValueError
  
      Use the parameter ``signed=True`` if converting a bytestring that can hold
      negative values. Then upper range data will be automatically converted into
      negative return values (two's complement).
  
      Use ``numberOfDecimals=1`` to divide the received data by 10 before returning the value.
      Similarly ``numberOfDecimals=2`` will divide the received data by 100 before returning the value.
  
      The byte order is big-endian, meaning that the most significant byte is sent first.
  
      For example:
          A string ``\\x03\\x02`` (which has the length 2) corresponds to 0302 (hex) = 770 (dec). If
          ``numberOfDecimals = 1``, then this is converted to 77.0 (float).