Possible Duplicate:
How do I use Python to convert a string to a number if it has commas in it as thousands separators?
How would I parse the string 1,000,000
(one million) into it's integer value in Python?
Possible Duplicate:
How do I use Python to convert a string to a number if it has commas in it as thousands separators?
How would I parse the string 1,000,000
(one million) into it's integer value in Python?
Replace the ',' with '' and then cast the whole thing to an integer.
There's also a simple way to do this that should handle internationalization issues as well:
I found though that I have to explicitly set the locale first otherwise it doesn't work for me and I end up with an ugly traceback instead:
So if that happens to you: