I have a string that represents a number which uses commas to separate thousands. How can I convert this to a number in python?
>>> int(\"1,000,000
This works:
(A dirty but quick way)
>>> a='-1,234,567,89.0123' >>> "".join(a.split(",")) '-123456789.0123'