The locale Module
Currency Formatting US Dollars Using the locale Module
import locale
locale.setlocale(locale.LC_ALL, '')
Out[2]: 'English_United States.1252'
locale.currency(762559748.49)
Out[3]: '$762559748.49'
locale.currency(762559748.49, grouping=True)
Out[4]: '$762,559,748.49'
Must Read Python Interview Questions
200+ Python Tutorials With Coding Examples
Other Python Tutorials
- What is Python?
- Python Advantages
- Python For Beginners
- Python For Machine Learning
- Machine Learning For Beginners
- 130+ Python Projects With Source Code On GitHub