first decimal place python code example
Example 1: python format only 1 decimal place
>>> "{0:0.1f}".format(45.34531)
'45.3'
Example 2: how to round to the nearest 25 python
def myround(x, base=5):
return base * round(x/base)
>>> "{0:0.1f}".format(45.34531)
'45.3'
def myround(x, base=5):
return base * round(x/base)