Are you trying to represent it with only one digit:

print("{:.1f}".format(number)) # Python3
print "%.1f" % number          # Python2

or actually round off the other decimal places?

round(number,1)

or even round strictly down?

math.floor(number*10)/10
Answer from relet on Stack Overflow
🌐
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 first decimal place of m. If d is less than 5, round m down to the nearest integer. Otherwise, round m up. Finally, shift the decimal point back p places by dividing m by 10ᵖ.
🌐
Python
docs.python.org › 3 › library › decimal.html
decimal — Decimal fixed-point and floating-point arithmetic
If ndigits is an int, the context’s rounding mode is respected and a Decimal representing number rounded to the nearest multiple of Decimal('1E-ndigits') is returned; in this case, round(number, ndigits) is equivalent to self.quantize(Decimal('1E-ndigits')). Returns Decimal('NaN') if number is a quiet NaN. Raises InvalidOperation if number is an infinity, a signaling NaN, or if the length of the coefficient after the quantize operation would be greater than the current context’s precision. In other words, for the non-corner cases: if ndigits is positive, return number rounded to ndigits decimal places;
🌐
TradingCode
tradingcode.net › python › math › round-decimals
How to round decimal places up and down in Python? • TradingCode
This is how the function rounded ... decimal places: Value: Rounded: 3.14159265359 3.15 1845.7409947 1845.75 -100.95 -100.95 9.5432 9.55 34.49953 34.5 · The third way to handle decimal digits is to always round down. This is what a strict teacher might use: rather than round 8.18 and 5.95 up, he or she instead rounds down to 8.1 and 5.9. There’s no built-in function in Python for that kind ...
🌐
Server Academy
serveracademy.com › blog › python-round-function-tutorial
Python Round() Function Tutorial - Server Academy
In this tutorial, we’ll cover everything you need to know about the round() function, including how to use it, how to round up or down, and practical examples for common rounding tasks.
Top answer
1 of 10
63

Seems like you need the floor:

import math
math.floor(a * 100)/100.0

# 28.26
2 of 10
39

It seems you want truncation, not rounding.

A simple way would be to combine floor division // and regular division /:

>>> a = 28.266
>>> a // 0.01 / 100
28.26

Instead of the regular division you could also multiply (as noted in the comments by cmc):

>>> a // 0.01 * 0.01
28.26

Similarly you could create a function to round down to other more/less decimals. But because floats are inexact numbers, this can lead to inaccuracies.

def round_down(value, decimals):
    factor = 1 / (10 ** decimals)
    return (value // factor) * factor

print(round_down(28.266, 2))
# 28.26

But as said it's not exactly exact:

for i in range(0, 8):
    print(i, round_down(12.33333, i))
0 12.0
1 12.3
2 12.33
3 12.333
4 12.333300000000001 # weird, but almost correct
5 12.33332           # wrong
6 12.33333
7 12.33333

There are other (more precise) approaches though:

A solution using the fraction module

A fraction can represent a decimal number much more exact than a float. Then one can use the "multiply, then floor, then divide" approach mentioned by Psidom but with significantly higher precision:

import fractions
import math

a = 28.266

def round_down(value, decimals):
    factor = 10 ** decimals
    f = fractions.Fraction(value)
    return fractions.Fraction(math.floor(f * factor),  factor)

print(round_down(28.266, 2))
# 1413/50  <- that's 28.26

And using the test I did with the floats:

for i in range(0, 8):
    print(i, round_down(12.33333, i))
0 12
1 123/10
2 1233/100
3 12333/1000
4 123333/10000
5 1233333/100000
6 1233333/100000
7 1233333/100000

However creating a Fraction will not magically fix an inexact float, so typically one should create the Fraction from a string or a "numerator-denominator pair" instead of from float.

A solution using the decimal module

You could also use the decimal module, which offers a variety of rounding modes, including rounding down.

For this demonstration I'm using a context manager to avoid changing the decimal rounding mode globally:

import decimal

def round_down(value, decimals):
    with decimal.localcontext() as ctx:
        d = decimal.Decimal(value)
        ctx.rounding = decimal.ROUND_DOWN
        return round(d, decimals)

print(round_down(28.266, 2))  # 28.26

Which gives more sensible results for the rounding:

for i in range(0, 8):
    print(i, round_down(12.33333, i))
0 12
1 12.3
2 12.33
3 12.333
4 12.3333
5 12.33333
6 12.333330
7 12.3333300

As with Fraction a Decimal should be created from a string to avoid the intermediate inexact float. But different from Fraction the Decimal have limited precision, so for values with lots of significant figures it will also become inexact.

However "rounding down" is just one of the available options. The list of available rounding modes is extensive:

Rounding modes

decimal.ROUND_CEILING Round towards Infinity.

decimal.ROUND_DOWN Round towards zero.

decimal.ROUND_FLOOR Round towards -Infinity.

decimal.ROUND_HALF_DOWN Round to nearest with ties going towards zero.

decimal.ROUND_HALF_EVEN Round to nearest with ties going to nearest even integer.

decimal.ROUND_HALF_UP Round to nearest with ties going away from zero.

decimal.ROUND_UP Round away from zero.

decimal.ROUND_05UP Round away from zero if last digit after rounding towards zero would have been 0 or 5; otherwise round towards zero.

Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › round-function-python
round() function in Python - GeeksforGeeks
Python round() function is a built-in function available with Python. It will return you a float number that will be rounded to the decimal places which are given as input. If the decimal places to be rounded are not specified, it is considered ...
Published   August 7, 2024
🌐
Bobby Hadz
bobbyhadz.com › blog › python-round-float-3-decimal-places
Round a Float to 1, 2 or 3 Decimal places in Python | bobbyhadz
We first multiply the number by 100 and then divide by 100 to shift 2 decimal places to the left and right, so that math.floor() works on the hundreds. ... Multiply the number by 100 and round the result down to the nearest integer.
🌐
Finxter
blog.finxter.com › home › learn python blog › 5 best ways to round a float to 1 decimal in python
5 Best Ways to Round a Float to 1 Decimal in Python - Be on the Right Side of Change
February 25, 2024 - By multiplying x by 10, we shift the decimal one place to the right. Adding 0.5 and then applying math.floor() effectively rounds the number down to the nearest whole number, which we then divide by 10 to shift the decimal back into place.
🌐
Quora
quora.com › How-do-I-round-my-answers-each-time-to-1-decimal-place-Python
How to round my answers each time to 1 decimal place? Python - Quora
Answer (1 of 5): As usual, the answer is: It depends. If you want to print a rounded answer, you need to look at floating point formatting. “%.1f” format specification will do that either using an f-string or the % style formatting. On the other hand, if you want to actually round the calculati...
🌐
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 simplest way to round a number in Python is to use the built-in round() function. The round() function takes a number as the first argument and an optional second argument to specify the number of decimal places to round to.
🌐
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.
🌐
Programiz
programiz.com › python-programming › methods › built-in › round
Python round()
from decimal import Decimal # normal float num = 2.675 · print(round(num, 2)) # using decimal.Decimal (passed float as string for precision) num = Decimal('2.675')
🌐
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 - 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. If ndigits is negative, it rounds to the left of the decimal (to the nearest ten, hundred, etc.). You can easily round to 1, 2, or 3 decimal ...
🌐
KnowledgeHut
knowledgehut.com › home › blog › data science › understanding python round function: guide to precise rounding
How to Round Numbers in Python? With Examples
October 8, 2025 - 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. If ndigits is negative, it rounds to the left of the decimal (to the nearest ten, hundred, etc.). You can easily round to 1, 2, or 3 decimal ...
🌐
Guru99
guru99.com › home › python › python round() function with examples
Python round() function with EXAMPLES
August 12, 2024 - Using round() 15.46 Using Decimal ... Decimal - ROUND_HALF_EVEN 15.46 Using Decimal - ROUND_HALF_UP 15.46 Using Decimal - ROUND_UP 15.46 · Round(float_num, Num_of_decimals) is a built-in function available with python....
🌐
freeCodeCamp
freecodecamp.org › news › how-to-round-to-2-decimal-places-in-python
How to Round to 2 Decimal Places in Python
August 22, 2022 - As another example, let's take 24.82 and round it to 1 decimal place (the nearest tenth). Since 2 is not larger than 5, 8 remains the same, and 2 gets rounded down – resulting in 24.8. Now that you understand how to round up a decimal place, let's see how to do it in Python.