랭귀지/python
python 숫자 출력에서 천(1000) 단위마다 콤마를 출력
유키공
2018. 11. 15. 09:00
python 숫자 출력에서 천(1000) 단위마다 콤마를 출력
1. format 지정 - 파이썬 2.7 이상value = 123456789 print "{:,}".format(value)
import locale print locale.setlocale(locale.LC_ALL, 'en_US') print locale.format("%d", 123456789, grouping=True)