From 64acf86fbea069b0ae9f9bce086f8ecce1e91b87 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 15 May 2024 18:17:36 -0400 Subject: [PATCH] fix total amounts in spread view --- .../desktop/main/market/spread/SpreadViewModel.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/desktop/src/main/java/haveno/desktop/main/market/spread/SpreadViewModel.java b/desktop/src/main/java/haveno/desktop/main/market/spread/SpreadViewModel.java index 2e5f56f3b4..2ca1d3e743 100644 --- a/desktop/src/main/java/haveno/desktop/main/market/spread/SpreadViewModel.java +++ b/desktop/src/main/java/haveno/desktop/main/market/spread/SpreadViewModel.java @@ -230,9 +230,13 @@ class SpreadViewModel extends ActivatableViewModel { } } - for (Offer offer : offers) totalAmount = totalAmount.add(offer.getAmount()); + BigInteger totalAmountForCurrency = BigInteger.ZERO; + for (Offer offer : offers) { + totalAmount = totalAmount.add(offer.getAmount()); + totalAmountForCurrency = totalAmountForCurrency.add(offer.getAmount()); + } spreadItems.add(new SpreadItem(key, buyOffers.size(), sellOffers.size(), - uniqueOffers.size(), spread, percentage, percentageValue, totalAmount)); + uniqueOffers.size(), spread, percentage, percentageValue, totalAmountForCurrency)); } maxPlacesForAmount.set(formatAmount(totalAmount, false).length());