diff --git a/src/matgl/cli.py b/src/matgl/cli.py index 79ea51fe..3fb551ca 100644 --- a/src/matgl/cli.py +++ b/src/matgl/cli.py @@ -57,7 +57,7 @@ def relax_structure(args): print("Sites (Fractional coordinates)") def fmt_fcoords(fc): - return np.array2string(fc, formatter={"float_kind": lambda x: "%.5f" % x}) + return np.array2string(fc, formatter={"float_kind": lambda x: f"{x:.5f}"}) for old_site, new_site in zip(structure, final_structure): print(f"{old_site.species}: {fmt_fcoords(old_site.frac_coords)} -> {fmt_fcoords(new_site.frac_coords)}")