Skip to content

Commit

Permalink
Merge pull request #3674 from bodymindarts/fix-bsq-monetary-format
Browse files Browse the repository at this point in the history
Use correct monetary format in BsqFormatter
  • Loading branch information
freimair authored Nov 25, 2019
2 parents d12a404 + fe00f4a commit 4c9d915
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions core/src/main/java/bisq/core/util/coin/BsqFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,13 @@ public class BsqFormatter implements CoinFormatter {

@Inject
public BsqFormatter() {
this.monetaryFormat = BisqEnvironment.getParameters().getMonetaryFormat();
this.immutableCoinFormatter = new ImmutableCoinFormatter(BisqEnvironment.getParameters().getMonetaryFormat());
this.btcCoinFormat = BisqEnvironment.getParameters().getMonetaryFormat();
this.monetaryFormat = new MonetaryFormat().shift(6).code(6, "BSQ").minDecimals(2);
this.immutableCoinFormatter = new ImmutableCoinFormatter(monetaryFormat);

GlobalSettings.localeProperty().addListener((observable, oldValue, newValue) -> switchLocale(newValue));
switchLocale(GlobalSettings.getLocale());

btcCoinFormat = monetaryFormat;

final String baseCurrencyCode = BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode();
switch (baseCurrencyCode) {
case "BTC":
monetaryFormat = new MonetaryFormat().shift(6).code(6, "BSQ").minDecimals(2);
break;
default:
throw new RuntimeException("baseCurrencyCode not defined. baseCurrencyCode=" + baseCurrencyCode);
}

amountFormat.setMinimumFractionDigits(2);
}

Expand Down

0 comments on commit 4c9d915

Please sign in to comment.