From 76af19b903115b2025675d495accc8906257ab5c Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Wed, 23 Feb 2022 21:13:28 +0100 Subject: [PATCH] Fixed sorting and currency display. --- .../java/nl/andrewl/coyotecredit/ctl/dto/TradeableData.java | 2 +- .../java/nl/andrewl/coyotecredit/service/AccountService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/nl/andrewl/coyotecredit/ctl/dto/TradeableData.java b/src/main/java/nl/andrewl/coyotecredit/ctl/dto/TradeableData.java index 1be60ca..0db9180 100644 --- a/src/main/java/nl/andrewl/coyotecredit/ctl/dto/TradeableData.java +++ b/src/main/java/nl/andrewl/coyotecredit/ctl/dto/TradeableData.java @@ -16,7 +16,7 @@ public record TradeableData( Long exchangeId, 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) { this( diff --git a/src/main/java/nl/andrewl/coyotecredit/service/AccountService.java b/src/main/java/nl/andrewl/coyotecredit/service/AccountService.java index b7d2ada..8563a75 100644 --- a/src/main/java/nl/andrewl/coyotecredit/service/AccountService.java +++ b/src/main/java/nl/andrewl/coyotecredit/service/AccountService.java @@ -138,7 +138,7 @@ public class AccountService { b.getTradeable().getType().name(), b.getAmount().toPlainString() )) - .sorted(Comparator.comparing(BalanceData::amount).thenComparing(BalanceData::symbol)) + .sorted(Comparator.comparing(BalanceData::amount).reversed().thenComparing(BalanceData::symbol)) .toList(), TradeableData.DECIMAL_FORMAT.format(account.getTotalBalance()), transactionData