python string formatting using float upto 3 decimals code example
Example 1: force two decimal places python
print ("{0:.2f}".format(a))
Example 2: force two decimal places python
print(round(a, 2))
print ("{0:.2f}".format(a))
print(round(a, 2))