aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-03-21 19:38:37 -0500
committermat <github@matdoes.dev>2022-03-21 19:38:37 -0500
commit07549e927248bed7aba73cb07e05bd3ac4345382 (patch)
tree6337b878e1b64583b4c5834328e96a50efc30335 /src
parent8f3aba2d78ae1341178271d359964a467c69947e (diff)
downloadskyblock-api-07549e927248bed7aba73cb07e05bd3ac4345382.tar.gz
skyblock-api-07549e927248bed7aba73cb07e05bd3ac4345382.tar.bz2
skyblock-api-07549e927248bed7aba73cb07e05bd3ac4345382.zip
fix total bank balance being off
Diffstat (limited to 'src')
-rw-r--r--src/cleaners/skyblock/bank.ts4
1 files changed, 2 insertions, 2 deletions
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
}
}