aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-03-21 15:17:20 +0000
committermat <github@matdoes.dev>2022-03-21 15:17:20 +0000
commita99878779302ea018594464142c016c8a302cb50 (patch)
tree5526041583b0c8917da77c72b0420b15d2eaaf47 /src/cleaners
parent54972dc067f3d5a18368b0b820317d60ee321238 (diff)
downloadskyblock-api-a99878779302ea018594464142c016c8a302cb50.tar.gz
skyblock-api-a99878779302ea018594464142c016c8a302cb50.tar.bz2
skyblock-api-a99878779302ea018594464142c016c8a302cb50.zip
round numbers in bank balance
Diffstat (limited to 'src/cleaners')
-rw-r--r--src/cleaners/skyblock/bank.ts6
1 files 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,
})