Language/python

[python] 소수점 n번째 자리까지 0으로 채우기

khakhalog 2023. 1. 6. 18:34
n = 45.0
print(format(n, '.2f'))
# 45.00

 

'Language > python' 카테고리의 다른 글

[python] set hashable  (0) 2023.06.23
[python] dict.setdefault / collections.defaultdict  (0) 2023.04.27