code: def _quantityToReal(self, quantity):
          
          if not quantity:
              return 1.0
  
          try:
              return float(quantity.replace(',', '.'))
          except ValueError:
              pass
  
          try:
              return float(self.ptc.numbers[quantity])
          except KeyError:
              pass
  
          return 0.0
docs: Convert a quantity, either spelled-out or numeric, to a float
  
          @type    quantity: string
          @param   quantity: quantity to parse to float
          @rtype:  int
          @return: the quantity as an float, defaulting to 0.0