python change decimal places for float code example Example: force two decimal places python print ("{0:.2f}".format(a))