diff --git a/manimlib/mobject/numbers.py b/manimlib/mobject/numbers.py index 79f05326..1181d191 100644 --- a/manimlib/mobject/numbers.py +++ b/manimlib/mobject/numbers.py @@ -116,13 +116,14 @@ class DecimalNumber(VMobject): ] ]) config.update(kwargs) + ndp = config["num_decimal_places"] return "".join([ "{", config.get("field_name", ""), ":", "+" if config["include_sign"] else "", "," if config["group_with_commas"] else "", - ".", str(config["num_decimal_places"]), "f", + f".{ndp}f", "}", ])