From 4f2420d4489e8e73cb8e356e1e3af7cbc89aabbd Mon Sep 17 00:00:00 2001 From: "Mohammed S. Yaseen" <51242349+mohasarc@users.noreply.github.com> Date: Sun, 25 Jan 2026 20:42:16 +0000 Subject: [PATCH] optimize string construction --- periodictable/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/periodictable/util.py b/periodictable/util.py index e729547..b7391d1 100644 --- a/periodictable/util.py +++ b/periodictable/util.py @@ -47,7 +47,7 @@ def parse_uncertainty(s): # e.g., 23.0035(12) but not 23(1) or 23.0(1.0) or 23(1.0) if '.' not in unc and '.' in value: zeros = len(value.split('.')[1]) - len(unc) - unc = "0." + ("0"*zeros) + unc + unc = "".join(["0.", "0" * zeros, unc]) return float(value), float(unc) # Plain value with no uncertainty