On 14/04/2013 19:57, pyth0n3r wrote:
Hi,
I came across a problem that when i deal with int data with ',' as
thousand separator, such as 12,916, i can not change it into int() or
float().
How can i remove the comma in int data?
Any reply will be appreciated!!
Best,
Chen



Use the string replace method thus.

>>> '12,916'.replace(',', '')
'12916'

--
If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython.

Mark Lawrence

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to