how to print f-string to 6 decimal places code example Example: f string decimal places >>> a = 10.1234 >>> f'{a:.2f}' '10.12'