use static formatter

This commit is contained in:
Craig Raw 2020-07-10 18:35:17 +02:00
parent d6218f2a58
commit 9b43429de9

View file

@ -87,9 +87,8 @@ public class FiatLabel extends CopyableLabel {
BigDecimal btcBalance = satsBalance.divide(BigDecimal.valueOf(Transaction.SATOSHIS_PER_BITCOIN)); BigDecimal btcBalance = satsBalance.divide(BigDecimal.valueOf(Transaction.SATOSHIS_PER_BITCOIN));
BigDecimal fiatBalance = btcBalance.multiply(BigDecimal.valueOf(getBtcRate())); BigDecimal fiatBalance = btcBalance.multiply(BigDecimal.valueOf(getBtcRate()));
DecimalFormat currencyFormat = new DecimalFormat("#,##0.00"); String label = getCurrency().getSymbol() + " " + CURRENCY_FORMAT.format(fiatBalance.doubleValue());
String label = getCurrency().getSymbol() + " " + currencyFormat.format(fiatBalance.doubleValue()); tooltip.setText("1 BTC = " + getCurrency().getSymbol() + " " + CURRENCY_FORMAT.format(getBtcRate()));
tooltip.setText("1 BTC = " + getCurrency().getSymbol() + " " + currencyFormat.format(getBtcRate()));
setText(label); setText(label);
setTooltip(tooltip); setTooltip(tooltip);