a_float = 3.14159 formatted_float = "{:.2f}".format(a_float)
print("{:.1f}".format(number)) # Python3 print "%.1f" % number # Python2