From 81476a419b701820053cda6e9e4d39b4971e5893 Mon Sep 17 00:00:00 2001 From: Caleb Bell Date: Sun, 17 Nov 2024 16:25:19 -0700 Subject: [PATCH] Use new rounding function --- chemicals/reaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chemicals/reaction.py b/chemicals/reaction.py index 96e1519..c494735 100644 --- a/chemicals/reaction.py +++ b/chemicals/reaction.py @@ -1089,7 +1089,7 @@ def balance_stoichiometry(matrix, rounding=9, allow_fractional=False): # raise ValueError("Could not find integer coefficients (%s, %s)" %(i, j)) # return d_as_int else: - d = [round(i, rounding + int(ceil(log10(abs(i))))) for i in d] + d = [round_to_significant(v, rounding) for v in d] return d def stoichiometry_molar_to_mass(coefficients, MWs):