mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-18 07:24:00 +01:00
fix: summing transactions with a lot of decimal places, drop the decimals
This commit is contained in:
@@ -60,11 +60,12 @@ _="on change from #transactions-list or htmx:afterSettle
|
||||
set total to 0.0
|
||||
for amt in <.transaction:has(input[name='transactions']:checked) .main-amount .amount/>
|
||||
set amountValue to parseFloat(amt.getAttribute('data-amount'))
|
||||
log amountValue
|
||||
if not isNaN(amountValue)
|
||||
set total to total + amountValue
|
||||
end
|
||||
end
|
||||
put total.toLocaleString() into me
|
||||
put total.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40}) into me
|
||||
end
|
||||
on click
|
||||
set original_value to my innerText
|
||||
|
||||
Reference in New Issue
Block a user