From ad1ecfb887b4de9803b08db88458fef8fcb0f65f Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 16 Jan 2024 12:19:56 +0200 Subject: [PATCH] fix changing amount bitcoin unit on send tab with comma decimal separator --- .../com/sparrowwallet/sparrow/wallet/PaymentController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java index 8b225779..549e2bda 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java @@ -287,7 +287,8 @@ public class PaymentController extends WalletFormController implements Initializ amountUnit.valueProperty().addListener((observable, oldValue, newValue) -> { Long value = getRecipientValueSats(oldValue); if(value != null) { - DecimalFormat df = new DecimalFormat("#.#", DecimalFormatSymbols.getInstance(Locale.ENGLISH)); + UnitFormat unitFormat = Config.get().getUnitFormat() == null ? UnitFormat.DOT : Config.get().getUnitFormat(); + DecimalFormat df = new DecimalFormat("#.#", unitFormat.getDecimalFormatSymbols()); df.setMaximumFractionDigits(8); amount.setText(df.format(newValue.getValue(value))); }