float = 2.154327 format_float = "{:.2f}".format(float) # change .2f to n digits you want print(format_float)