xxxxxxxxxx
# This is elegant because it will keep the number the same if there is no % sign
float("99.5%".replace('%', 'e-2'))
xxxxxxxxxx
from re import sub
from decimal import Decimal
money = '$6,150,593.22'
value = Decimal(sub(r'[^\d.]', '', money))