Parse currency into numbers in Python
问题 I just learnt from Format numbers as currency in Python that the Python module babel provides babel.numbers.format_currency to format numbers as currency. For instance, from babel.numbers import format_currency s = format_currency(123456.789, 'USD', locale='en_US') # u'$123,456.79' s = format_currency(123456.789, 'EUR', locale='fr_FR') # u'123\xa0456,79\xa0\u20ac' How about the reverse, from currency to numbers, such as $123,456,789.00 --> 123456789 ? babel provides babel.numbers.parse_number