python콤마 (1) 썸네일형 리스트형 django / template에서 1000단위(천단위) comma 표시 php를 쓰다가 django로 넘어오다보니 구글링이 더 늘었다. 1. php, python 포맷 비교 php에서 사용하는 천단위 콤마 포맷 {{ number_format($price) }} {{ number_format(1000) }} // 1,000 python에서 사용하는 천단위 콤마 포맷 print(format(price, ",")) print(format(1000, ",")) # 1,000 2. django에서 효율적으로 사용하기 위한 포맷 Add 1. Settings.py 파일에 'mathfilters' 추가 INSTALLED_APPS = [ . . 'django.contrib.humanize', . . ] 2. 사용할 template에 {% load humanize %} 추가 {% load h.. 이전 1 다음