fix changing amount bitcoin unit on send tab with comma decimal separator

This commit is contained in:
Craig Raw 2024-01-16 12:19:56 +02:00
parent 6a5060c0c8
commit ad1ecfb887

View file

@ -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)));
}