How to convert 45.34531 to 45.3 ?
45.34531
45.3
You are trying to imagine it with only one digit:
print "%.1f" % number
or actually round other decimals?
round(number,1)
or even round strictly down?
math.floor(number*10)/10
>>> "{0:0.1f}".format(45.34531) '45.3'
Or use the inline round:
>>> round(45.34531, 1) 45.299999999999997
round(number, 1)