truncate to 2 decimal places python code example
Example 1: force two decimal places python
print ("{0:.2f}".format(a))
Example 2: how to round to two places python
round(number, decimal places)
Example 3: force two decimal places python
print(round(a, 2))