python – Rounding floats with f-string ByMartin March 3, 2022 python – Rounding floats with f-string How about this x = 3.14159265 print(fpi = {x:.2f}) Docs for f-strings python – Rounding floats with f-string