Actually, you could still use the round function:

>>> print round(1123.456789, -1)
1120.0

This would round to the closest multiple of 10. To 100 would be -2 as the second argument and so forth.

Answer from data on Stack Overflow
๐ŸŒ
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.
๐ŸŒ
Real Python
realpython.com โ€บ python-rounding
How to Round Numbers in Python โ€“ Real Python
December 7, 2024 - To do that, multiply n by 10แต– (10 raised to the p power) to get a new number, m. Then look at the digit d in the first decimal place of m. If d is less than 5, round m down to the nearest integer.
๐ŸŒ
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 - The math library in Python provides the ceil() and floor() functions to round numbers up and down, respectively, to the nearest integer. These functions are useful when you need to work with integer values, especially in cases like calculating ...
๐ŸŒ
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.
Find elsewhere
๐ŸŒ
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.
๐ŸŒ
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.
๐ŸŒ
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
By dividing by 10, using the int() function, and then applying strategic addition before multiplying back by 10, you can round a float to the nearest 10. ... This code snippet leverages the fact that the int() function truncates the decimal, allowing for rounding down.
๐ŸŒ
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
๐ŸŒ
Medium
medium.com โ€บ 4geeksacademy โ€บ how-to-round-in-python-cf547f8c9376
How to Round in Python? | by 4Geeks Academy | 4GeeksAcademy | Medium
June 20, 2023 - Here is a code snippet that shows how to round a number in Python: number = 3.78 rounded_number = round(number) print(rounded_number) # Output: 4 ยท In the previous example we rounded to the nearest integer number the variable number which value was 3.78.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ 2.1 โ€บ reference โ€บ generated โ€บ numpy.round.html
numpy.round โ€” NumPy v2.1 Manual
>>> import numpy as np >>> np.round([0.37, 1.64]) array([0., 2.]) >>> np.round([0.37, 1.64], decimals=1) array([0.4, 1.6]) >>> np.round([.5, 1.5, 2.5, 3.5, 4.5]) # rounds to nearest even value array([0., 2., 2., 4., 4.]) >>> np.round([1,2,3,11], decimals=1) # ndarray of ints is returned array([ 1, 2, 3, 11]) >>> np.round([1,2,3,11], decimals=-1) array([ 0, 0, 0, 10])
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ dsa โ€บ round-the-given-number-to-nearest-multiple-of-10
Round the given number to nearest multiple of 10 - GeeksforGeeks
June 19, 2024 - DSA Python ยท Last Updated : 19 Jun, 2024 ยท Given a positive integer n, round it to nearest whole number having zero as last digit. Examples: Input : 4722 Output : 4720 Input : 38 Output : 40 Input : 10 Output: 10 ยท Recommended Practice ยท ...
๐ŸŒ
Delft Stack
delftstack.com โ€บ home โ€บ howto โ€บ python โ€บ python round up to the nearest ten
How to Round Up to the Nearest Ten in Python | Delft Stack
February 2, 2024 - Specifically, we divide 21 by 10, ... of y which is 30, representing the result of rounding 21 to the nearest ten using the ceil() function....
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_func_round.asp
Python round() Function
The default number of decimals is 0, meaning that the function will return the nearest integer. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-round-numbers-up-or-down-in-python
Python Round to Int โ€“ How to Round Up or Round Down to the Nearest Whole Number
May 24, 2022 - The first parameter โ€“ number โ€“ is the number we are rounding to the nearest whole number. The second parameter โ€“ decimal_digits โ€“ is the number of decimals to be returned. The default value is 0. Let's see some examples. ... In our first example, we're using only one parameter โ€“ the number to be rounded, which is 2.56789. When we passed in the number variable to the round() function, it got rounded to the nearest whole number which is 3.
๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ python-round-up
How to Round Up a Number in Python | DataCamp
July 22, 2024 - Python uses the math module, NumPy, and Pandas libraries to offer different methods of rounding up numbers. The math.ceil() function from math is used to round up a number to the nearest integer.
๐ŸŒ
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....