From 07549e927248bed7aba73cb07e05bd3ac4345382 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 21 Mar 2022 19:38:37 -0500 Subject: fix total bank balance being off --- src/cleaners/skyblock/bank.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cleaners/skyblock/bank.ts b/src/cleaners/skyblock/bank.ts index 7424a75..4eace04 100644 --- a/src/cleaners/skyblock/bank.ts +++ b/src/cleaners/skyblock/bank.ts @@ -18,14 +18,14 @@ export function cleanBank(data: any): Bank { // we go in reverse so we can simulate the bank transactions for (const transaction of data.banking.transactions.sort((a, b) => b.timestamp - a.timestamp)) { const change = transaction.action === 'DEPOSIT' ? transaction.amount : -transaction.amount - // since we're going in reverse, we remove from the total balance when adding to the history - bankBalance -= change history.push({ change: Math.round(change * 10) / 10, total: Math.round(bankBalance * 10) / 10, timestamp: transaction.timestamp, name: transaction.initiator_name, }) + // since we're going in reverse, we remove from the total balance when adding to the history + bankBalance -= change } } -- cgit