diff --git a/core/src/main/java/haveno/core/trade/HavenoUtils.java b/core/src/main/java/haveno/core/trade/HavenoUtils.java index dd66e5155f..d74eab2394 100644 --- a/core/src/main/java/haveno/core/trade/HavenoUtils.java +++ b/core/src/main/java/haveno/core/trade/HavenoUtils.java @@ -188,7 +188,6 @@ public class HavenoUtils { try { return xmrToAtomicUnits(new BigDecimal(input).doubleValue()); } catch (Exception e) { - log.warn("Exception at parseXmr: " + e.toString()); return BigInteger.valueOf(0); } } diff --git a/desktop/src/main/java/haveno/desktop/main/overlays/windows/OfferDetailsWindow.java b/desktop/src/main/java/haveno/desktop/main/overlays/windows/OfferDetailsWindow.java index d16bd68919..15891c39f6 100644 --- a/desktop/src/main/java/haveno/desktop/main/overlays/windows/OfferDetailsWindow.java +++ b/desktop/src/main/java/haveno/desktop/main/overlays/windows/OfferDetailsWindow.java @@ -407,7 +407,7 @@ public class OfferDetailsWindow extends Overlay { placeOfferHandlerOptional.ifPresent(Runnable::run); } else { State lastState = Trade.State.ARBITRATOR_PUBLISHED_DEPOSIT_TXS; - spinnerInfoLabel.setText(Res.get("takeOffer.fundsBox.takeOfferSpinnerInfo") + " 1/" + (lastState.ordinal() + 1)); + spinnerInfoLabel.setText(Res.get("takeOffer.fundsBox.takeOfferSpinnerInfo") + " " + getPercentString(0, lastState.ordinal())); takeOfferHandlerOptional.ifPresent(Runnable::run); // update trade state progress @@ -415,7 +415,7 @@ public class OfferDetailsWindow extends Overlay { Trade trade = tradeManager.getTrade(offer.getId()); if (trade == null) return; tradeStateSubscription = EasyBind.subscribe(trade.stateProperty(), newState -> { - String progress = (newState.ordinal() + 1) + "/" + (lastState.ordinal() + 1); + String progress = getPercentString(newState.ordinal(), lastState.ordinal()); spinnerInfoLabel.setText(Res.get("takeOffer.fundsBox.takeOfferSpinnerInfo") + " " + progress); // unsubscribe when done @@ -429,4 +429,8 @@ public class OfferDetailsWindow extends Overlay { } }); } + + private static String getPercentString(int newOrdinal, int lastOrdinal) { + return (int) ((double) newOrdinal / (double) lastOrdinal * 100) + "%"; + } }