how to convert cost to float in python

Solutions on MaxInterview for how to convert cost to float in python by the best coders in the world

showing results for - "how to convert cost to float in python"
Alaska
29 Jun 2020
1from re import sub
2from decimal import Decimal
3
4money = '$6,150,593.22'
5value = Decimal(sub(r'[^\d.]', '', money))