code: def to_float(unit):
      
      def converter(x):
          """Convert the input to a `float` in %s
          """
          return Quantity(x, unit).value
  
      converter.__doc__ %= str(unit)  # pylint: disable=no-member
      return converter
docs: Factory to build a converter from quantity string to float
  
      Examples
      --------
      >>> conv = to_float('Hz')
      >>> conv('4 mHz')
      >>> 0.004