>>> a = '1,000,000' >>> int(a.replace(',', '')) 1000000
- 出自於
- http://stackoverflow.com/questions/2953746/python-parse-comma-separated-number-into-int
- 相關
- How to convert a numeric string with place-value commas into an integer?
- http://stackoverflow.com/questions/2308443/how-to-convert-a-numeric-string-with-place-value-commas-into-an-integer
- How do I use Python to convert a string to a number if it has commas in it as thousands separators?
- http://stackoverflow.com/questions/1779288/how-do-i-use-python-to-convert-a-string-to-a-number-if-it-has-commas-in-it-as-th
- How can I convert a string with dot and comma into a float number in Python
- http://stackoverflow.com/questions/6633523/how-can-i-convert-a-string-with-dot-and-comma-into-a-float-number-in-python
- 相反
- Python Add Comma Into Number String
- http://stackoverflow.com/questions/5180365/python-add-comma-into-number-string