diff --git a/src/inifix/enotation.py b/src/inifix/enotation.py index fcf9aef..79c351f 100644 --- a/src/inifix/enotation.py +++ b/src/inifix/enotation.py @@ -137,8 +137,7 @@ def encode(r: float, /) -> str: return "0e0" max_ndigit = len(base.replace(".", "")) - 1 fmt = f".{max_ndigit}e" - s = "{:^{}}".format(r, fmt) - return ENotationIO.simplify(s) + return ENotationIO.simplify(f"{r:{fmt}}") @staticmethod def encode_preferential(r: float, /) -> str: