@davoodmehraban89 / Aram-1 / commits / a24b8f6
Fork 0

fix(decimal): exact sums must handle only zero amounts

davoodmehraban89 committed Oct 31, 2026 at 00:36 UTC a24b8f60e6b3576b2a058c1ba26f4f4b456d2b95
1 file changed +1 -1
backend/src/aram_backend/coverage_preview.py
+1 -1
@@ -294,7 +294,7 @@ def preview_mapping_coverage(
294 ))
295
296 # Exact decimal aggregation, including mixed tiny and huge balances.
297 - positive_digits = max(1, *(amount.adjusted() + 1 for amount in all_amounts if amount))
297 + positive_digits = max((amount.adjusted() + 1 for amount in all_amounts if amount), default=1)
298 fractional_digits = max(0, *(-amount.as_tuple().exponent for amount in all_amounts))
299 precision = max(100, positive_digits + fractional_digits + len(str(len(all_amounts))) + 4)
300 with localcontext() as ctx: