As you are talking about trailing zeros, this is a question about representation as string, you can use

>>> "%.2f" % round(2606.89579999999, 2)
'2606.90'

Or use modern style with format function:

>>> '{:.2f}'.format(round(2606.89579999999, 2))
'2606.90'

and remove point with replace or translate (_ refers to result of previous command in python console):

>>> _.translate(None, '.')
'260690'

Note that rounding is not needed here, as .2f format applies the same rounding:

>>> "%.2f" % 2606.89579999999
'2606.90'

But as you mentioned excel, you probably would opt to roll your own rounding function, or use decimal, as float.round can lead to strange results due to float representation:

>>> round(2.675, 2)
2.67
>>> round(2606.89579999999, 2)
2606.89

With decimal use quantize:

>>> from decimal import *
>>> x = Decimal('2606.8950000000001')
# Decimal('2606.8950000000001')
>>> '{}'.format(x.quantize(Decimal('.01'), rounding=ROUND_HALF_EVEN))
'2606.90'

That, for your original task, becomes:

>>> x = Decimal('2606.8950000000001')
>>> int((x*100).quantize(1, rounding=ROUND_HALF_EVEN))
260690

And the reason of strange rounding comes to the front with Decimal:

>>> x = Decimal(2606.8950000000001)
# Decimal('2606.89499999999998181010596454143524169921875') # internal float repr
Answer from alko on Stack Overflow
Top answer
1 of 6
96

As you are talking about trailing zeros, this is a question about representation as string, you can use

>>> "%.2f" % round(2606.89579999999, 2)
'2606.90'

Or use modern style with format function:

>>> '{:.2f}'.format(round(2606.89579999999, 2))
'2606.90'

and remove point with replace or translate (_ refers to result of previous command in python console):

>>> _.translate(None, '.')
'260690'

Note that rounding is not needed here, as .2f format applies the same rounding:

>>> "%.2f" % 2606.89579999999
'2606.90'

But as you mentioned excel, you probably would opt to roll your own rounding function, or use decimal, as float.round can lead to strange results due to float representation:

>>> round(2.675, 2)
2.67
>>> round(2606.89579999999, 2)
2606.89

With decimal use quantize:

>>> from decimal import *
>>> x = Decimal('2606.8950000000001')
# Decimal('2606.8950000000001')
>>> '{}'.format(x.quantize(Decimal('.01'), rounding=ROUND_HALF_EVEN))
'2606.90'

That, for your original task, becomes:

>>> x = Decimal('2606.8950000000001')
>>> int((x*100).quantize(1, rounding=ROUND_HALF_EVEN))
260690

And the reason of strange rounding comes to the front with Decimal:

>>> x = Decimal(2606.8950000000001)
# Decimal('2606.89499999999998181010596454143524169921875') # internal float repr
2 of 6
30

As of Python 3.6, you can also use an f-string to inline format the number. In this case, the desired format is floating point with 2 decimal places so you would use .2f as the format specifier:

x = 2606.89579999999
x = round(x, 2)      # not strictly necessary as format will round for you
print(f'{x:.2f}')

Output:

2606.90
🌐
Python Forum
python-forum.io › thread-7788.html
Controlling trailing zeros with rounding?
I'm trying to print out floats in currency format, but no matter what numbers I specify for rounding parameters, it only prints out one 0 after the decimal point: #!/usr/bin/env python3 #FormattingStuff.py def listOfFloats(): floatsList = [20.00...
Discussions

Python force round with trailing zeroes with variable in f-string
The following f-string f"{a:.5f}" will round the variable a to 5 decimals, no matter if the are zero. How can i do this for n amount of decimals… More on reddit.com
🌐 r/learnpython
1
3
November 27, 2023
python round leaving a trailing 0 - Stack Overflow
Connect and share knowledge within a single location that is structured and easy to search. Learn more about Teams ... Closed 12 years ago. I am trying to round a floating point number in python to zero decimal places. However, the round method is leaving a trailing 0 every time. More on stackoverflow.com
🌐 stackoverflow.com
How to eliminate trailing zeros?
Since you're already formatting the number as a string, you could just check to see if the last value is a '0', then remove it. Not an efficient solution, but something readable so you have an idea: number = 25.159 num_string = format(number, ".2f") if num_string[-1] == '0': formatted_num = num_string[:-1] else: formatted_num = num_string print(formatted_num) More on reddit.com
🌐 r/learnpython
13
3
October 3, 2019
General way to print floats without the .0 part
I’m building SVG code using data interpolation (f-strings and .format), and I have elements (the size of the graph for one) that are internally floats but which are usually integers. But when printing floats, the .0 part is always included. Is there a standard str-interpolation idiom that ... More on discuss.python.org
🌐 discuss.python.org
0
0
May 19, 2024
🌐
Reddit
reddit.com › r/learnpython › how do i get numpy.round to display trailing zeros?
r/learnpython on Reddit: How do I get numpy.round to display trailing zeros?
March 9, 2023 -

Is this possible? I need to display 2 decimal points, even if both numbers are zeros. I've tried the {:0.2f}.format method but get an error that numpy doesn't work with strings.

This is my current code and output.

print("Observed Prices: ",np.round(y_test_1[0:10],2))
print("Estimated Prices:",np.round(test_pred_1[0:10],2))

Observed Prices: [33 45 54 38 22 47 38 51 46 47]

Estimated Prices: [19. 20. 24. 21. 21. 21. 18. 22. 23. 20.]

🌐
Real Python
realpython.com › python-rounding
How to Round Numbers in Python – Real Python
December 7, 2024 - Preservation of significant digits: When you add 1.20 and 2.50, the result is 3.70, with the trailing zero maintained to indicate significance. User-alterable precision: The default precision of the decimal module is twenty-eight digits, but you can alter this value to match the problem at hand. But how does rounding work in the decimal module? Start by typing the following into a Python REPL:
🌐
Python
bugs.python.org › issue41198
Issue 41198: Round built-in function not shows zeros acording significant figures and calculates different numbers of odd and even - Python tracker
July 2, 2020 - This issue tracker has been migrated to GitHub, and is currently read-only. For more information, see the GitHub FAQs in the Python's Developer Guide · This issue has been migrated to GitHub: https://github.com/python/cpython/issues/85370
🌐
AskPython
askpython.com › home › how to format floats without trailing zeros?
How to Format Floats Without Trailing Zeros? - AskPython
May 12, 2023 - Python offers four effective methods to remove trailing zeros from float values: the to_integral() and normalize() functions, the str() and rstrip() functions, a while loop, and the float() function.
🌐
Kaggle
kaggle.com › questions-and-answers › 388405
[Python] Adding trailing zeros to every value in a column ...
Checking your browser before accessing www.kaggle.com · Click here if you are not automatically redirected after 5 seconds
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-add-trailing-zeros-to-string
Add trailing Zeros to string-Python - GeeksforGeeks
July 11, 2025 - This operation is commonly used in formatting, padding, or aligning strings for display or data processing. For example, adding 4 zeros to "GFG" should result in "GFG0000". Let’s explore some efficient approaches to achieve this in Python. This is the most efficient way to add trailing zeros. By multiplying the string '0' with N, we get a string of N zeros.
🌐
Sololearn
sololearn.com › en › Discuss › 3288381 › how-to-round-to-2-decimal-places-in-python
How to round to 2 decimal places in python | Sololearn: Learn to code for FREE!
Yes, you can use the round() function in Python to round a float to a specific number of decimal places. In your case, you can use round(number, 2) to round the number to 2 decimal places.
🌐
Kodeclik
kodeclik.com › remove-trailing-zeros-in-python-string
How to remove Trailing Zeros from a given Python String
July 15, 2025 - To keep the notation simple we reverse the string for use in an iterator and then re-reverse it (using string slicing operators) after the zeros are removed. ... The above code can be made more succinct using Python’s string slicing operators in a while loop. For instance, consider the following code: ... The rstrip() method operates on a given string and returns a string with trailing characters removed (and you can specify which trailing characters you are interested in).
🌐
W3Schools
w3schools.com › python › ref_func_round.asp
Python round() Function
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... The round() function returns a floating point number that is a rounded version of the specified number, with the specified number of decimals.
🌐
Reddit
reddit.com › r/learnpython › python force round with trailing zeroes with variable in f-string
r/learnpython on Reddit: Python force round with trailing zeroes with variable in f-string
November 27, 2023 - The following f-string f"{a:.5f}" will round the variable a to 5 decimals, no matter if the are zero. How can i do this for n amount of decimals…
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.format_float_scientific.html
numpy.format_float_scientific — NumPy v2.5.dev0 Manual
If False, digits are generated as if printing an infinite-precision value and stopping after precision digits, rounding the remaining value with unbiased rounding · trimone of ‘k’, ‘.’, ‘0’, ‘-’, optional · Controls post-processing trimming of trailing digits, as follows: ‘k’ : keep trailing zeros, keep decimal point (no trimming)
🌐
Reddit
reddit.com › r/learnpython › how to eliminate trailing zeros?
r/learnpython on Reddit: How to eliminate trailing zeros?
October 3, 2019 -

I have a float formatted to 2 decimal places. I need to eliminate the 2nd decimal place if it's a "0" but still keep 2 decimal places open for when its 2 whole numbers.

number = float(25.20458)
    print(format(number, ".2f"))
#Comes out as 25.20
#Need 25.2

Windows 10 and Python 3.7

🌐
Python.org
discuss.python.org › python help
General way to print floats without the .0 part - Python Help - Discussions on Python.org
May 19, 2024 - I’m building SVG code using data interpolation (f-strings and .format), and I have elements (the size of the graph for one) that are internally floats but which are usually integers. But when printing floats, the .0 par…
🌐
Luasoftware
code.luasoftware.com › tutorials › python › python-format-float-without-trailing-zeros
Python Format Float Without Trailing Zeros
Related articlesPython Encryption Using TinkPython Only Allow Single Instance to Run (or Kill Previous Instance)Python Asyncio Graceful Shutdown (Interrupt Sleep)Simple Guide to Subprocess (launch another python script)Simple Guide to Python AsyncioSimple Guide to Python MultiprocessingPython FTP: List Files in Directory and DownloadGoogle OAuth2 Build Google REST Api Service on LocalSimple Guide to Python ThreadingPython 3.x: Threading vs Multiprocessing vs AsyncioPython 3.x Float Rounding Error (Decimal)Complete Guide to Python Variable Arguments (varargs, args, kwargs)Setup and Access Googl
🌐
YouTube
youtube.com › speak with ujjwal
How to add zero at the end of a decimal number in Python ? - YouTube
How to add trailing zero at the end of a decimal number in Python format function in Python
Published   July 21, 2020
Views   1K
🌐
Esri Community
community.esri.com › t5 › arcgis-survey123-questions › survey123-how-to-maintain-trailing-zeros-in › td-p › 865486
Solved: Survey123: How to maintain trailing zeros in round... - Esri Community
July 28, 2020 - I have that note field set to round to 6 decimal places, but in cases where there are zeros at the end of the coordinate, it does not display the zero. Here is an example: For consistency in the final reports, it is important this this field always have 6 decimal places, even when the last number is a zero.