Using Python v2, I have the user entering an amount into a string as below:
RawPurchaseAmount = raw_input(\"Please enter purchase amount: \") PurchaseAmount
>>> x = '$10,00.00' >>> ''.join(e for e in x if e.isdigit() or e == '.') '1000.00'
Remove the $, any other character, except a digit or a . in one go.
$
.