You can specify the number of decimal places before %:

>>> f'{0.123:.2%}' 
'12.30%'
Answer from Lord Elrond on Stack Overflow
🌐
Medium
medium.com › bitgrit-data-science-publication › python-f-strings-tricks-you-should-know-7ce094a25d43
Python F-strings Tricks You Should Know | by Benedict Neo | bitgrit Data Science Publication | Medium
October 12, 2022 - Or, if you want f string to print out a percentage value, you can use :.2% telling Python to set 2 decimal places and add a percentage sign to the end of the string.
🌐
Real Python
realpython.com › videos › dealing-with-percentages
Dealing With Percentages in F-Strings (Video) – Real Python
Normally when it’s a tax rate, you want to say 20%. So once again, you can put the colon and put the percentage sign, and it says the tax rate is 20%, yes, but with lots of zeros, we don’t want that.
Published   November 12, 2024
🌐
DZone
dzone.com › coding › languages › python f-strings
Python F-Strings
August 22, 2023 - To format a number as a percentage using F-strings, simply include the number inside the curly braces, followed by a colon and the % symbol: ... x = 0.75 print(f"{x:.2%} of the time, it works every time.") #Output 75.00% of the time, it works ...
🌐
Miguendes
miguendes.me › 73-examples-to-help-you-master-pythons-f-strings
Python F-String: 73 Examples to Help You Master It
July 2, 2022 - Python f-strings have a very convenient way of formatting percentage. The rules are similar to float formatting, except that you append a % instead of f. It multiplies the number by 100 displaying it in a fixed format, followed by a percent sign.
🌐
Bentley
cissandbox.bentley.edu › sandbox › wp-content › uploads › 2022-02-10-Documentation-on-f-strings-Updated.pdf pdf
A Guide to Formatting with f-strings in Python - CIS Sandbox
Percentage. Multiplies the number by 100 and displays in fixed ('f') format, ... The variable, variable, is enclosed in curly braces { }. When variable = 10, the f-string
🌐
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 - In fact, Python will multiple the value by 100 and add decimal points to your precision. number = 0.9124325345 print(f'Percentage format for number with two decimal places: {number:.2%}') # Returns # Percentage format for number with two decimal places: 91.24%
Find elsewhere
🌐
YouTube
youtube.com › shorts › 9r5erT-OL44
How To Display Percentages With F-Strings - YouTube
In this python tutorial, I show you how to display percentages with f-strings! Let's get coding!======== Ask Case Digital ========If you have a question you ...
Published   December 8, 2024
🌐
Finxter
blog.finxter.com › home › learn python blog › how to print a percentage value in python?
How to Print a Percentage Value in Python? - Be on the Right Side of Change
May 31, 2022 - To print a percentage value in Python, use the str.format() method or an f-string on the format language pattern "{:.0%}". For example, the f-string f"{your_number:.0%}" will convert variable your_number to a percentage string with 0 digits precision. Simply run those three basic statements ...
🌐
Reddit
reddit.com › r/python › do you normally use string.format() or percentage (%) to format your python strings?
r/Python on Reddit: Do you normally use string.format() or percentage (%) to format your Python strings?
June 3, 2018 -

There are two ways of string formatting in python and I've been consistently using the percentage (%) method until now:

"Today is %s." % datetime.now() # 2018-06-03 16:50:35.226194
"%d is a good number." % 5 # 5

I know this may not be very eloquent, but does the job well. One of the major irritants for me is the number to string conversion, I've faced that error so many times in the earlier days when I simply used to "There are " + x + " mangoes.". This works great in most other languages as they "auto-convert" the x from integer to string, but not python because of its "explicitness". But today, I learned of this new method of string.format() which does the same job, perhaps more eloquently:

"Today is {0}.".format(datetime.now()) # 2018-06-03 16:50:35.226194 
"{0} is a good number.".format(5) # 5

The only problem I'd imagine would be when you have to deal with long floats:

f = 1.234535666
"this is a floating point number: {0}".format(f) # 1.234535666

Problem here is that it will output the entire float as it is without rounding, and here is where my percentage method has an edge!

"this is a floating point number: %.2f" % f # 1.23
🌐
ZetCode
zetcode.com › python › fstring
Python f-string - formatting strings in Python with f-string
May 11, 2025 - The first line prints the raw decimal value, while the second line displays it as a percentage with two decimal places. This is useful for reports and data analysis. ... You can set the width of formatted values in f-strings, which is useful for aligning columns in tables or reports.
🌐
GeeksforGeeks
geeksforgeeks.org › python › different-ways-to-escape-percent-in-python-strings
Different Ways to Escape percent (%) in Python strings - GeeksforGeeks
July 23, 2025 - When using f-strings, the percent sign can be included directly in the string without any need for special escaping: ... # Using f-strings percentage = 75 formatted_string = f"The success rate is {percentage}%." print(formatted_string)
🌐
w3resource
w3resource.com › python-exercises › string › python-data-type-string-exercise-36.php
Python: Format a number with a percentage - w3resource
June 12, 2025 - Write a Python program to convert a decimal number into a percentage format with two decimal places. Write a Python program to use f-string formatting to display a float as a percentage with a '%' symbol appended.
🌐
Pythonmldaily
pythonmldaily.com › posts › python-show-number-as-percentage-with-format-and-f-string
Show Number as Percentage with Format and F-String
December 7, 2023 - Before you can access this site, we need to verify you’re human · Verification failed. Please refresh and try again
Top answer
1 of 2
3
Here's what I have as a reference. Basically a summary of the Format Specification Mini-Language . This would all go after a : in the f-string curly braces. So if you want a float with 2 decimal place precision, with * as fill and right aligned in a field width of 10 characters you'd do f"{val:*>10.2f}" [[fill]align][sign][#][0][minimumwidth][.precision][type] Fill: Add a character to fill with. Must be followed by Align flag. Align: '<' - Forces the field to be left-aligned within the available space (This is the default.) '>' - Forces the field to be right-aligned within the available space. '=' - Forces the padding to be placed after the sign (if any) but before the digits. This is used for printing fields in the form '+000000120'. This alignment option is only valid for numeric types. '^' - Forces the field to be centered within the available space. Sign: '+' - indicates that a sign should be used for both positive as well as negative numbers '-' - indicates that a sign should be used only for negative numbers (this is the default behavior) ' ' - indicates that a leading space should be used on positive numbers #: Flags alternate numbering formats; binary, octal, and hexadecimal output will be prefixed with '0b', '0o', and '0x', respectively. 0: Zero-padding. Equivalent to fill '=' and character of '0' Minimumwidth: Min width of the field. Precision: Decimal places for floats or max field size for non-numeric types. Type: Integers: 'b' - Binary. Outputs the number in base 2. 'c' - Character. Converts the integer to the corresponding Unicode character before printing. 'd' - Decimal Integer. Outputs the number in base 10. 'o' - Octal format. Outputs the number in base 8. 'x' - Hex format. Outputs the number in base 16, using lower- case letters for the digits above 9. 'X' - Hex format. Outputs the number in base 16, using upper- case letters for the digits above 9. 'n' - Number. This is the same as 'd', except that it uses the current locale setting to insert the appropriate number separator characters. '' (None) - the same as 'd' Floats: 'e' - Exponent notation. Prints the number in scientific notation using the letter 'e' to indicate the exponent. 'E' - Exponent notation. Same as 'e' except it converts the number to uppercase. 'f' - Fixed point. Displays the number as a fixed-point number. 'F' - Fixed point. Same as 'f' except it converts the number to uppercase. 'g' - General format. This prints the number as a fixed-point number, unless the number is too large, in which case it switches to 'e' exponent notation. 'G' - General format. Same as 'g' except switches to 'E' if the number gets to large. 'n' - Number. This is the same as 'g', except that it uses the current locale setting to insert the appropriate number separator characters. '%' - Percentage. Multiplies the number by 100 and displays in fixed ('f') format, followed by a percent sign. '' (None) - similar to 'g', except that it prints at least one digit after the decimal point.
2 of 2
1
A cheat sheet for f-string would be too short and kind of useless since f-string are super simple. If you want to put a number just do it. Ex. name: str = "Albus Dumbledore" age: int = 116 print(f"Name: {name}, Age: {age}") As you can see, I simply put age (which is an int) inside 2 brackets in the string (don't forget the f) and let Python do it's magic. (If you want you can use the example above as your cheat sheet)
🌐
Stack Abuse
stackabuse.com › python-string-interpolation-with-the-percent-operator
Python String Interpolation with the Percent (%) Operator
August 24, 2023 - Represents a hexadecimal integer using lowercase letters (a-f). >>> number = 15 >>> print("%i in hex is x" % (number, number)) 15 in hex is 0f · By using the "02" prefix in our placeholder, we're telling Python to print a two-character hex string.
🌐
Built In
builtin.com › data-science › python-f-string
Guide to String Formatting in Python Using F-strings | Built In
Summary: Python f-strings, introduced in version 3.6, allow cleaner string formatting by embedding variables directly. They support alignment, zero-padding, decimal precision, percentage display, comma separators and date formatting, making code more readable and debugging easier.
🌐
Python Morsels
pythonmorsels.com › string-formatting
Python f-string tips & cheat sheets - Python Morsels
April 12, 2022 - If you'd like to space-pad floating point numbers, check out >N in the section on strings below. The .N% format specifier (where N is a whole number) formats a number as a percentage.
🌐
Medium
medium.com › @pivajr › pythonic-tips-how-to-format-percentage-values-in-python-bf9a5500d761
Pythonic Tips: How to Format Percentage Values in Python | by Dilermando Piva Junior | Medium
June 20, 2025 - The % symbol after the precision specifier acts like a translator: It multiplies the number by 100 and appends the percentage symbol. The number before % (like .1 or .2) controls decimal places— like adjusting the focus on a camera lens: more ...
🌐
AskPython
askpython.com › python › examples › print-a-percentage-value-in-python
How To Print A Percentage Value In Python? - AskPython
April 21, 2023 - Percentage Value Using Format Function (With Precision) The output of example 2 is 88.89% which is correct! The f-string in Python works similarly as a format function. The f-string is used with curly braces, and ‘f’ is used as a prefix. This f-string will replace the things from the curly braces with the given string.