def _quantityToReal(self, quantity):
if not quantity:<EOL><INDENT>return <NUM_LIT:1.0><EOL><DEDENT>try:<EOL><INDENT>return float(quantity.replace('<STR_LIT:U+002C>', '<STR_LIT:.>'))<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>return float(self.ptc.numbers[quantity])<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>return <NUM_LIT:0.0><EOL>
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