How to format float number with comma thousands separators in Python

1 Answer

0 votes
s = '{:,.2f}'.format(82538945.2345)
print(s)

s = '{:,.2f}'.format(123.34)
print(s)  

s = '{:,.2f}'.format(1000.598)
print(s)  

s = '{:,.2f}'.format(5987)
print(s)  



'''
run:
   
82,538,945.23
123.34
1,000.60
5,987.00
   
'''

 



answered Oct 19, 2020 by avibootz

Related questions

...