Fixed sorting and currency display.

This commit is contained in:
Andrew Lalis 2022-02-23 21:13:28 +01:00
parent b53a254a1c
commit 76af19b903
2 changed files with 2 additions and 2 deletions

View File

@ -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(

View File

@ -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