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

How to format Python decimals to remove trailing zeroes? - TestMu AI Community
How can I format a Python decimal to remove unnecessary trailing zeroes while keeping a maximum of two decimal places? For example, I want the output to look like this: 1.00 --> '1' 1.20 --> '1.2' 1.23 --> '1.23' 1.234 --> '1.23' 1.2345 --> '1.23' What is the best approach to achieve this in ... More on community.testmuai.com
🌐 community.testmuai.com
0
November 7, 2024
Rounding to significant figures - feature request for math library - Ideas - Discussions on Python.org
The python standard library doesn’t have any function (that I am aware of) to round a number to a number of significant figures. This is a very useful thing to be able to do and I have written a simple function to do it for 2-3 projects now. In the math library we have functions such as round(), ... More on discuss.python.org
🌐 discuss.python.org
4
June 9, 2022
How do I get numpy.round to display trailing zeros?
https://numpy.org/doc/stable/reference/generated/numpy.set_printoptions.html More on reddit.com
🌐 r/learnpython
2
1
March 9, 2023
Stuck. Help with keeping trailing zeros.
You're confusing data with the representation of that data. You're not "losing" the trailing zero because -91.990 is the same as -91.99; these are just two different representations of the same piece of data. If you want to show a number to three decimal places you don't have to change the number itself. Instead, you change the way you convert that number into a string to be displayed. You can use string formatting to get what you want: print('{:.3f}'.format(-91.99)) More on reddit.com
🌐 r/learnpython
2
1
December 13, 2014
🌐
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.
🌐
TutorialsPoint
tutorialspoint.com › How-to-round-down-to-2-decimals-a-float-using-Python
How to round down to 2 decimals a float using Python?
August 29, 2023 - Round the number upto 2 digits (here 2 decimal palace . hence we give 2 zeros after the decimal point) after the decimal point using the value.quantize(decimal.Decimal()) function.
🌐
Python
docs.python.org › 3 › library › decimal.html
decimal — Decimal fixed-point and floating-point arithmetic
This has the same semantics as the unary plus operation, except that if the final result is finite it is reduced to its simplest form, with all trailing zeros removed and its sign preserved. That is, while the coefficient is non-zero and a multiple of ten the coefficient is divided by ten and the exponent is incremented by 1. Otherwise (the coefficient is zero) the exponent is set to 0. In all cases the sign is unchanged. For example, Decimal('32.100') and Decimal('0.321000e+2') both normalize to the equivalent value Decimal('32.1'). Note that rounding is applied before reducing to simplest form.
🌐
TestMu AI Community
community.testmuai.com › ask a question
How to format Python decimals to remove trailing zeroes? - TestMu AI Community
November 7, 2024 - How can I format a Python decimal to remove unnecessary trailing zeroes while keeping a maximum of two decimal places? For example, I want the output to look like this: 1.00 --> '1' 1.20 --> '1.2' 1.23 --> '1.23' …
🌐
Upgrad
upgrad.com › home › blog › data science › understanding python round function: guide to precise rounding
Round Function in Python [2025] – Explained for Beginners
October 8, 2025 - When working with decimals, the Python round function helps you control how many digits appear after the decimal point. This is useful when you need clean, readable numbers in reports, currency calculations, or scientific results. ... Here, ndigits defines how many decimal places you want to keep. If ndigits is positive, Python rounds to that many places after the decimal. If ndigits is zero or not given, Python rounds to the nearest whole number.
🌐
CSDN
devpress.csdn.net › python › 630450f07e66823466199a1d.html
Rounding a number in Python but keeping ending zeros_python_Mangs-Python
All other numbers that get rounded, if the rounded value doesn't end in '0', work fine with round(i, 2), but if the numbers just so happen to end in *.x0, that 0 gets dropped off and messes with the data. As you are talking about trailing zeros, this is a question about representation as string, you can use ... and remove point with replace or translate (_ refers to result of previous command in python console):
🌐
YouTube
youtube.com › statistics globe
Keep Trailing Zeros in R (2 Examples) | How to Round Number & Show Zero | sprintf & paste0 Functions - YouTube
How to keep zeros at the end of a number in the R programming language. More details: https://statisticsglobe.com/keep-trailing-zeros-rR code of this video: ...
Published   August 19, 2022
Views   635
🌐
Python.org
discuss.python.org › ideas
Rounding to significant figures - feature request for math library - Ideas - Discussions on Python.org
June 9, 2022 - The python standard library doesn’t have any function (that I am aware of) to round a number to a number of significant figures. This is a very useful thing to be able to do and I have written a simple function to do it for 2-3 projects now. In the math library we have functions such as round(), ceil() etc, but nothing for rounding to a number of significant figures.
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › hardware and peripherals › raspberry pi pico › micropython
rounded values as strings - Raspberry Pi Forums
Python 3 converts that to an integer type. The MicroPython for Pi results are close, just one obvious discrepancy for this test case ... ... pi@Pi3B:/tmp $ micropython round.py 997.4567 997 997 997.5 997.5 997.4600000000001 997.46 997.457 997.457 997.4567 997.4567 ... Mon Feb 01, 2021 9:31 am str(round(1.2015,2)) can never give the intended result of '1.20'. Because the trailing zero ...
🌐
Toppr
toppr.com › guides › python-guide › references › methods-and-functions › methods › built-in › round › python-round
Python round() function | What is Python round() function used for? |
August 30, 2021 - If the number of decimal places to round is not specified, it is assumed to be 0 and will be rounded to the nearest integer. The syntax followed by Python’s round() function is as follows:
🌐
Studytonight
studytonight.com › python-howtos › how-to-round-floating-value-to-two-decimals-in-python
How to Round Floating Value to Two Decimals in Python - Studytonight
January 21, 2021 - Just use the formatting with %.2f which gives you round down to 2 decimal points. number= 7.361 print("\"Sir, your shopping bill amount is Rs. %.2f ." % number) Sir, your shopping bill amount is Rs. 7.36. Python math module provides ceil() and floor() functions to rounded up and rounded down the any value. The floor and ceiling functions generally map a real number to the largest previous or smallest following integer which has zero decimal places.