def to_float(unit):
def converter(x):<EOL><INDENT>"""<STR_LIT>"""<EOL>return Quantity(x, unit).value<EOL><DEDENT>converter.__doc__ %= str(unit)  <EOL>return converter<EOL>
Factory to build a converter from quantity string to float

    Examples
    --------
    >>> conv = to_float('Hz')
    >>> conv('4 mHz')
    >>> 0.004