python rounding to 2 decimal places in f-string code example Example: f string float format >>> a = 10.1234 >>> f'{a:.2f}' '10.12'