print 1 decimal python code example
Example 1: print decimal formatting in python
a_float = 3.14159
formatted_float = "{:.2f}".format(a_float)
Example 2: print upto 1 decimal place python
print("{:.1f}".format(number)) # Python3
print "%.1f" % number # Python2