See the locale module.

This does currency (and date) formatting.

>>> import locale
>>> locale.setlocale( locale.LC_ALL, '' )
'English_United States.1252'
>>> locale.currency( 188518982.18 )
'$188518982.18'
>>> locale.currency( 188518982.18, grouping=True )
'$188,518,982.18'
Answer from S.Lott on Stack Overflow
🌐
Jerry Ng
jerrynsh.com › 3-useful-python-f-string-tricks-you-probably-dont-know
3 Useful Python F-string Tricks You Probably Don’t Know
August 3, 2021 - Format float type variable as a pretty-looking currency. Simple! Besides using it to format float type variables, we can even use f-string along with datetime type variable.
🌐
VDCI
vdci.edu › formatting numbers with python: using apply and lambda
Formatting Numbers with Python: Using Apply and Lambda - Free Video Tutorial
May 4, 2025 - Create a reusable format_currency function using f-strings and include commas to convert numeric values into properly formatted dollar amounts (e.g., $50,000,000).
🌐
Real Python
realpython.com › python-f-strings
Python's F-String for String Interpolation and Formatting – Real Python
November 30, 2024 - They provide some string formatting ... 35)) Name: John Age: 35 · In the first example, you use the %.2f conversion specifier to represent currency values....
🌐
The Python Coding Stack
thepythoncodingstack.com › the python coding stack › the curious little shop at the end of my street • python's f-strings
The Curious Little Shop at The End of My Street • Python's f-strings
June 25, 2024 - The dollar sign replaced the pound currency sign, and the expression in the second pair of curly brackets now includes two variable names and the multiplication operator: price * gbp_usd.
🌐
Marketcalls
marketcalls.in › home › mastering python f-string formatting: a trader’s guide
Mastering Python F-String Formatting: A Trader’s Guide
November 15, 2023 - Trading involves dealing with a lot of data, including prices, volumes, dates, and percentages. F-strings allow traders to format this data succinctly and clearly in their Python scripts or Jupyter notebooks.
🌐
W3Schools
w3schools.com › python › python_string_formatting.asp
Python String Formatting
Before Python 3.6 we had to use the format() method. F-string allows you to format selected parts of a string.
🌐
Replit
replit.com › home › discover › how to format a number as currency in python
How to format a number as currency in Python | Replit
For more details on looping through dictionaries, see our comprehensive guide. Inside the loop, an f-string dynamically combines the symbol with the formatted number, producing a clean output for each currency.
Find elsewhere
🌐
Real Python
realpython.com › how-to-python-f-string-format-float
How to Format Floats Within F-Strings in Python – Real Python
April 24, 2024 - Note: When you define a format using the form ".2e", you are using a similar, but not identical, formatting language to the language used by the more modern format specifiers. This time, you are using old-style printf-style string formatting. If you want to display currencies, you can use the locale.currency() function:
🌐
DNMTechs
dnmtechs.com › currency-formatting-in-python-3-simplified-guide
Currency Formatting in Python 3: Simplified Guide – DNMTechs – Sharing and Storing Technology Knowledge
This will output the formatted currency value as “$1,234.56”. The “:,.2f” specifier inside the f-string formats the value as a float with two decimal places and comma as the thousands separator. In this simplified guide, we explored different methods to format currency values in Python 3.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-format-numbers-as-currency-strings-in-python
How to format numbers as currency strings in Python - GeeksforGeeks
July 23, 2025 - Formatting numbers as currency strings in Python involves presenting numeric values in the standardized currency format typically including the currency symbol, thousands separators and the number of the decimal places.
🌐
ZetCode
zetcode.com › python › fstring
Python f-string - formatting strings in Python with f-string
May 11, 2025 - Beyond basic formatting, f-strings enable advanced operations such as inline calculations, function calls, and even conditional expressions. This versatility makes them suitable for a wide range of applications in Python development, from constructing log messages to formatting financial data.
🌐
Python Guides
pythonguides.com › format-decimal-places-in-python-using-f-strings
How To Format Decimal Places In Python Using F-Strings?
March 19, 2025 - As a developer working on numerous projects across the USA, I recently faced an issue where I needed to format currency values with a specific number of decimal places for our financial reports. After researching various string formatting techniques, I found that using f-strings is an efficient and readable way to format decimal places. I will help you learn how to format decimal places in Python using f-strings in this tutorial with examples.
🌐
AskPython
askpython.com › home › fixed digits after decimal with f-string
Fixed digits after decimal with F-string - AskPython
May 31, 2023 - Let’s see the example to understand the working of the f-string model. ... In this syntax, the value contains the number with a decimal point. After ‘.’, we need to define the number of fixed digits we want to print after the decimal point, followed by the ‘f’ letter. Value = 'Askpython' print(f"you can learn Python from {Value}.com")
🌐
Unstop
unstop.com › home › blog › f-string in python | syntax, usage & more (+code examples)
f-string In Python | Syntax, Usage & More (+Code Examples)
January 13, 2025 - Currency Symbol: ₹ is added directly into the string for context. The f-strings work well with Python’s datetime module, allowing you to format dates and times for better readability.
🌐
datagy
datagy.io › home › python posts › python f-strings: everything you need to know!
Python f-strings: Everything you need to know! • datagy
December 20, 2022 - F-strings can also be used to apply number formatting directly to the values. Python can take care of formatting values as percentages using f-strings.
🌐
Stack Abuse
stackabuse.com › format-number-as-currency-string-in-python
How to Format Number as Currency String in Python
February 24, 2023 - number_string = 340020.8 # This portion is responsible for grouping the number number_commas_only = "{:,}".format(number_string) print(number_commas_only) # To ensure we have two decimal places number_two_decimal = "{:.2f}".format(number_string) print(number_two_decimal) # Both combined along with the currency symbol(in this case $) currency_string = "${:,.2f}".format(number_string) print(currency_string) Running the code above we get the following output: ... Though, this approach is hard-coded, unlike the previous one, which you can use to localize the formatting dynamically. Using Babel is perhaps one of the lesser known methods, however it's very user-friendly and intuitive. It comes with number and currency formatting as well as other internationalizing tasks. Unlike Python's locale module, you don't have to worry about making adjustments on a global scale.
🌐
Tutorial Reference
tutorialreference.com › python › examples › faq › python-how-to-format-number-with-separator-for-thousands-and-currency
How to Format Numbers with Thousands Separators and Currency in Python | Tutorial Reference
This guide explores various methods in Python to format numbers with thousands separators and as currency, using f-strings, str.format(), and the locale module.
🌐
PyPI
pypi.org › project › multicurrency
multicurrency · PyPI
March 26, 2021 - # Using the `f-string` method >>> from multicurrency import Euro >>> euro = Euro(1000000*(1/7)) >>> f'{euro:4%a}' '142.857,1429' Some more examples of the Currency formatting feature usage (using the f-string method):
      » pip install multicurrency