From a99878779302ea018594464142c016c8a302cb50 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 21 Mar 2022 15:17:20 +0000 Subject: round numbers in bank balance --- src/cleaners/skyblock/bank.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cleaners/skyblock/bank.ts b/src/cleaners/skyblock/bank.ts index b1a9e38..dd18c24 100644 --- a/src/cleaners/skyblock/bank.ts +++ b/src/cleaners/skyblock/bank.ts @@ -12,7 +12,7 @@ export interface BankHistoryItem { export function cleanBank(data: any): Bank { let history: BankHistoryItem[] = [] - + if (data?.banking?.transactions) { let bankBalance = Math.round(data.banking.balance * 10) / 10 // we go in reverse so we can simulate the bank transactions @@ -21,8 +21,8 @@ export function cleanBank(data: any): Bank { // since we're going in reverse, we remove from the total balance when adding to the history bankBalance -= change history.push({ - change: change, - total: bankBalance, + change: Math.round(change * 10) / 10, + total: Math.round(bankBalance * 10) / 10, timestamp: transaction.timestamp, name: transaction.initiator_name, }) -- cgit