diff --git a/src/main/java/com/sparrowwallet/sparrow/UnitFormat.java b/src/main/java/com/sparrowwallet/sparrow/UnitFormat.java index 41a1afb2..85ec8331 100644 --- a/src/main/java/com/sparrowwallet/sparrow/UnitFormat.java +++ b/src/main/java/com/sparrowwallet/sparrow/UnitFormat.java @@ -82,6 +82,10 @@ public enum UnitFormat { return getBtcFormat().format(amount.doubleValue() / Transaction.SATOSHIS_PER_BITCOIN); } + public String tableFormatBtcValue(Long amount) { + return getTableBtcFormat().format(amount.doubleValue() / Transaction.SATOSHIS_PER_BITCOIN); + } + public String formatSatsValue(Long amount) { return getSatsFormat().format(amount); } diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java index 6463f6ac..52d8dcc6 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java @@ -142,7 +142,7 @@ public class TransactionsController extends WalletFormController implements Init private String getCoinValue(Long value) { UnitFormat format = Config.get().getUnitFormat() == null ? UnitFormat.DOT : Config.get().getUnitFormat(); - return BitcoinUnit.BTC.equals(transactionsTable.getBitcoinUnit()) ? format.formatBtcValue(value) : String.format(Locale.ENGLISH, "%d", value); + return BitcoinUnit.BTC.equals(transactionsTable.getBitcoinUnit()) ? format.tableFormatBtcValue(value) : String.format(Locale.ENGLISH, "%d", value); } private void logMessage(String logMessage) { diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java index a80ee786..109ae174 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java @@ -491,7 +491,7 @@ public class UtxosController extends WalletFormController implements Initializab private String getCoinValue(Long value) { UnitFormat format = Config.get().getUnitFormat() == null ? UnitFormat.DOT : Config.get().getUnitFormat(); - return BitcoinUnit.BTC.equals(utxosTable.getBitcoinUnit()) ? format.formatBtcValue(value) : String.format(Locale.ENGLISH, "%d", value); + return BitcoinUnit.BTC.equals(utxosTable.getBitcoinUnit()) ? format.tableFormatBtcValue(value) : String.format(Locale.ENGLISH, "%d", value); } private static Glyph getExternalGlyph() {