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
🌐
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.
Discussions

how to handle Currency in python ?
Use f-strings or format with the precision specified. val = 10 print("{:.2f}".format(val)) print(f"{val:.2f}") Be aware that floats aren't always accurate . If you're displaying them, there should be no issues. but calculations involving currency might drift off after some time. More on reddit.com
🌐 r/learnpython
10
3
March 22, 2021
python - Converting Float to Dollars and Cents - Stack Overflow
First of all, I have tried this post (among others): Currency formatting in Python. It has no affect on my variable. My best guess is that it is because I am using Python 3 and that was code for ... More on stackoverflow.com
🌐 stackoverflow.com
Help With Formatting Int Values in List
My first iteration used float values but, I was informed this is not ideal for currency, and that I should instead use integers in cents instead of dollars. So 500 became 50000. That is one way to do it. However, Python has the decimal module, which doesn't have the problems base 2 floats have, so you can just use that and not worry about doing all calculations in cents. (Which also only works as long as you don't have to work with sub cent prices) More on reddit.com
🌐 r/learnpython
25
5
April 7, 2024
How do I show currency with two decimal places
You can use a decimal specifier with f-strings: f"{amount:.2f}". Docs for further reading More on reddit.com
🌐 r/learnpython
15
24
September 11, 2022
🌐
Stack Abuse
stackabuse.com › format-number-as-currency-string-in-python
How to Format Number as Currency String in Python
February 24, 2023 - In this tutorial, we'll cover how to format a number as a currency string in Python, using the built-in str.format() method, the locale module and the Babel module.
🌐
Real Python
realpython.com › lessons › format-currency-solution
Format Currency (Solution) (Video) – Real Python
Now, to group the thousands, you can include a comma in the formatting string like so. 00:39 The comma has to come before the .2f. If the amount gets bigger by any chance, then Python will add the subsequent commas as necessary. 00:50 We’re almost there. The last point, which isn’t explicitly listed in the exercise instructions, is about adding the currency symbol.
Published   November 7, 2023
🌐
Medium
medium.com › paulacy-pulse › python-format-currency-exercise-in-python-01914d4addf1
PYTHON — Format Currency Exercise in Python | by Laxfed Paulacy | Straight Bias Devs
February 27, 2024 - In this exercise, you will learn how to format an integer number as a currency amount in Python. This includes adding the currency symbol, grouping thousands with commas, and ensuring that the amount…
🌐
Replit
replit.com › home › discover › how to format a number as currency in python
How to format a number as currency in Python | Replit
The real power for currency formatting comes from the format specifier, which follows the colon inside the curly braces. In f"${amount:,.2f}", the specifier gives Python direct instructions on how to present the number.
🌐
Python
docs.python.org › 3.4 › library › locale.html
23.2. locale — Internationalization services — Python 3.4.10 documentation
June 16, 2019 - Processes formatting specifiers as in format % val, but takes the current locale settings into account. locale.currency(val, symbol=True, grouping=False, international=False)¶
Find elsewhere
🌐
DNMTechs
dnmtechs.com › currency-formatting-in-python-3-simplified-guide
Currency Formatting in Python 3: Simplified Guide – DNMTechs – Sharing and Storing Technology Knowledge
For example, instead of displaying “1000.50,” currency formatting would represent it as “$1,000.50” in the United States or “€1.000,50” in Europe. In Python 3, you can achieve currency formatting by utilizing the built-in locale module or by using string formatting techniques.
🌐
W3Schools
w3schools.com › python › python_string_formatting.asp
Python String Formatting
A modifier is included by adding a colon : followed by a legal formatting type, like .2f which means fixed point number with 2 decimals: ... You can perform Python operations inside the placeholders.
🌐
W3Schools
w3schools.com › asp › func_formatcurrency.asp
VBScript FormatCurrency Function
The FormatCurrency function returns an expression formatted as a currency value using the currency symbol defined in the computer's control panel.
🌐
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 - Format numeric values as currency strings with dollar signs and commas using a custom function or lambda with apply.
🌐
Real Python
realpython.com › lessons › format-currency-exercise
Format Currency (Exercise) (Video) – Real Python
In this exercise, you are going to format an integer number as a currency amount. You need to ensure that you include the currency symbol, such as the dollar sign. You’ll also want to group thousands with commas and include two decimal places, even…
Published   November 7, 2023
🌐
PyPI
pypi.org › project › money
money · PyPI
All code examples use Python 3.x. ... amount can be any valid value in decimal.Decimal(value) and currency should be a three-letter currency code. Money objects are immutable by convention and hashable.
      » pip install money
    
Published   Apr 17, 2016
Version   1.3.0
🌐
IQCode
iqcode.com › code › python › python-format-currency
python format currency Code Example
October 22, 2021 - def as_currency(amount): if amount >= 0: return '${:,.2f}'.format(amount) else: return '-${:,.2f}'.format(-amount) ... Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
🌐
SICORPS
sicorps.com › h0me › money formatting: a comprehensive guide
Money Formatting: A Comprehensive Guide -
March 16, 2024 - # Import the decimal module to work with decimal numbers from decimal import * # Set the precision for decimal calculations to 2 digits getcontext().prec = 2 # Define a variable for the stock price as a decimal number stock_price = Decimal('1.00') # Define a function to format the stock price with custom options def moneyfmt(value, places=2): # Convert the decimal number to a string with the specified number of decimal places s = str(round(value, places)) # Split the string into two parts, before and after the decimal point whole, decimal = s.split(".") # Add a comma every three digits in the
🌐
Finxter
blog.finxter.com › 5-best-ways-to-convert-python-float-to-currency-format
5 Best Ways to Convert Python Float to Currency Format – Be on the Right Side of Change
This code rounds the float to two decimal places and then formats it as a currency string, which is straightforward but lacks locale-specific formatting. Method 1: Format Specification Mini-Language. Offers precision with extensive formatting options. May be unfamiliar to new Python users.
🌐
sqlpey
sqlpey.com › python › top-5-methods-to-solve-currency-formatting-in-python
Top 5 Methods to Solve Currency Formatting in Python - …
November 6, 2024 - I am striving to transform a number like 188518982.18 into a format that reads as £188,518,982.18 using Python. What are the best methods to achieve this formatting? Here, I will discuss five distinct approaches that can help you format currency efficiently and effectively in Python.