mirror of
https://github.com/bisq-network/bisq.git
synced 2025-01-19 05:44:05 +01:00
Use correct monetary format in BsqFormatter
Also remove logic regarding base currency. Only BTC is currently supported so there is no need to keep the logic around.
This commit is contained in:
parent
d12a4049ad
commit
fe00f4aac9
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user