float = 2.154327 format_float = "{:.2f}".format(float) print(format_float)
print("{:.1f}".format(number)) # Python3 print "%.1f" % number # Python2