Fixed sorting and currency display.
This commit is contained in:
parent
b53a254a1c
commit
76af19b903
|
@ -16,7 +16,7 @@ public record TradeableData(
|
||||||
Long exchangeId,
|
Long exchangeId,
|
||||||
String exchangeName
|
String exchangeName
|
||||||
) {
|
) {
|
||||||
public static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#,##0.00");
|
public static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#,##0.0000");
|
||||||
|
|
||||||
public TradeableData(Tradeable t) {
|
public TradeableData(Tradeable t) {
|
||||||
this(
|
this(
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class AccountService {
|
||||||
b.getTradeable().getType().name(),
|
b.getTradeable().getType().name(),
|
||||||
b.getAmount().toPlainString()
|
b.getAmount().toPlainString()
|
||||||
))
|
))
|
||||||
.sorted(Comparator.comparing(BalanceData::amount).thenComparing(BalanceData::symbol))
|
.sorted(Comparator.comparing(BalanceData::amount).reversed().thenComparing(BalanceData::symbol))
|
||||||
.toList(),
|
.toList(),
|
||||||
TradeableData.DECIMAL_FORMAT.format(account.getTotalBalance()),
|
TradeableData.DECIMAL_FORMAT.format(account.getTotalBalance()),
|
||||||
transactionData
|
transactionData
|
||||||
|
|
Loading…
Reference in New Issue