round does take negative ndigits parameter!

>>> round(46,-1)
50

may solve your case.

Answer from ch3ka on Stack Overflow
🌐
FavTutor
favtutor.com › blogs › round-down-python
Round Down Numbers in Python (With Examples and Code)
September 3, 2022 - Python's floor division operator, aka the integer division operator, is like math.floor() method. It divides the first number by the second and then rounds down the result to the nearest lower integer.
🌐
AskPython
askpython.com › home › 2 ways to round a float to nearest 10th
2 Ways to Round a Float to Nearest 10th - AskPython
August 27, 2023 - We are taking input from the user that is stored in the variable called num1. With the help of def keyword, we have created a function called round_to_10f. In this function, we are using 1f to print the nearest 10th digit of the float input.
🌐
Real Python
realpython.com › python-rounding
How to Round Numbers in Python – Real Python
December 7, 2024 - Then look at the digit d in the ... round m down to the nearest integer. Otherwise, round m up. Finally, shift the decimal point back p places by dividing m by 10ᵖ. It’s an algorithm!
🌐
TutorialKart
tutorialkart.com › python › python-round › python-round-to-nearest-10
Python - Round Number to Nearest 10
November 30, 2020 - Python - To round number to nearest 10, use round() function. We can divide the value by 10, round the result to zero precision, and multiply with 10 again. Or you can pass a negative value for precision.
🌐
GeeksforGeeks
geeksforgeeks.org › python › round-function-python
round() function in Python - GeeksforGeeks
If the decimal places to be rounded are not specified, it is considered as 0, and it will round to the nearest integer. In this article, we will see Python how to Round Numbers using round() function. ... if a decimal number is given, then it ...
Published   August 7, 2024
🌐
Mimo
mimo.org › glossary › python › round-function
Mimo: The coding platform you need to learn Web Development, Python, and more.
Using a negative value for the ndigits parameter, the round() function can round a floating-point number or integer to a multiple of 10. In the following example, we round 12345 to the nearest hundred (12300), simplifying the value. ... Python’s round() function works well in many cases.
Find elsewhere
🌐
Inspector
inspector.dev › home › round up numbers to integer in python – fast tips
Round Up Numbers to Integer in Python - Inspector.dev
June 17, 2025 - On the other hand, floor() will always round down the number to the nearest integer, even if the fractional part is closer to the higher integer. These functions are particularly useful when you want to ensure that a value is never underestimated or overestimated when working with whole numbers or discrete quantities. Bankers’ rounding is the default rounding method in Python.
🌐
Bobby Hadz
bobbyhadz.com › blog › python-round-number-to-nearest-100
Round a number to the nearest 5, 10, 100, 1000 in Python | bobbyhadz
Multiply the result by 10 to get the number rounded up to the nearest 10. Use the math.floor() method to round down to the nearest 10.
🌐
datagy
datagy.io › home › python posts › round number to the nearest multiple in python (2, 5, 10, etc.)
Round Number to the Nearest Multiple in Python (2, 5, 10, etc.) • datagy
April 13, 2023 - In this tutorial, you’ll learn how to use Python to round a number to a nearest multiple, such as the nearest 2, 5, or 10. Being able to round numbers is a helpful skill, as it often makes them easier to understand and to use. Python makes it simple to round a number up or down, but rounding ...
🌐
InterServer
interserver.net › home › programming › python round() function explained: examples, decimals, and best practices
Python round() Function Explained: Examples, Decimals, and Best Practices - Interserver Tips
October 1, 2025 - You can round a number to two decimal ... when rounded to one or two decimals. You can also round numbers to the nearest 10, 100, or even 1000 by using negative ndigits....
🌐
Finxter
blog.finxter.com › 5-best-ways-to-round-floats-to-the-nearest-10-in-python
5 Best Ways to Round Floats to the Nearest 10 in Python – Be on the Right Side of Change
The code snippet takes a floating-point number, divides it by 10, which results in a smaller float that, when rounded using the round() function, becomes the nearest integer. After rounding, the result is multiplied back by 10 to get the number rounded to the nearest 10. Python’s int() function ...
🌐
W3Schools
w3schools.com › python › ref_math_floor.asp
Python math.floor() Method
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 ... # Import math library import math # Round numbers down to the nearest integer print(math.floor(0.6)) print(math.floor(1.4)) print(math.floor(5.3)) print(math.floor(-5.3)) print(math.floor(22.6)) print(math.floor(10.0)) Try it Yourself »
🌐
Reddit
reddit.com › r/learnpython › how to round a value in a print statement to the nearest 100?
r/learnpython on Reddit: How to round a value in a print statement to the nearest 100?
January 30, 2019 -

So I have a list of floats that I am manipulating in a function. On the output of the function, I would like to round this to the nearest 100. So I would like to rounding to be like this: 157395.85 ----> 157400.00.

Here is an example of the code I wrote:

x = 157395.85

print(round(x, 4))

This did not run correctly. Another issue I noticed was that if the float had a zero at the last digit after the decimal, the zero was not listed. What I mean is that 50000.50 is stored as 50000.5.

Any help would be great!

Edit: To all that have commented, your solutions were amazing thank you so much! I've upvoted all your comments.