From cb2de69ec2f8f870ac26a058ea65445bc4365951 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Mon, 18 Nov 2024 10:46:48 -0300 Subject: [PATCH] fix: rounding erros when summing transactions --- app/templates/cotton/ui/transactions_action_bar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/cotton/ui/transactions_action_bar.html b/app/templates/cotton/ui/transactions_action_bar.html index 8ed9d06..4921f94 100644 --- a/app/templates/cotton/ui/transactions_action_bar.html +++ b/app/templates/cotton/ui/transactions_action_bar.html @@ -61,7 +61,7 @@ _="on change from #transactions-list or htmx:afterSettle for amt in <.transaction:has(input[name='transactions']:checked) .main-amount .amount/> set amountValue to parseFloat(amt.getAttribute('data-amount')) if not isNaN(amountValue) - set total to (total * 100) + (amountValue * 100) + set total to total + (amountValue * 100) end end set total to total / 100