make LINQ statement simpler

This commit is contained in:
Florian Stinglmayr 2021-08-27 22:15:56 +02:00
parent 7e66691d66
commit ec872e4aec
2 changed files with 3 additions and 3 deletions

View File

@ -4,6 +4,8 @@ namespace EDJournal {
public class Credits {
public static string FormatCredits(int amount) {
var format = CultureInfo.CurrentCulture.NumberFormat;
format.NumberGroupSeparator = ",";
format.NumberGroupSizes = new int[1] { 3 };
if ((amount % 1000000) == 0) {
amount /= 1000000;
return string.Format("{0}M CR", amount.ToString(format));

View File

@ -38,9 +38,7 @@ namespace EDJournal {
public JournalFile GetLastFile() {
var lastfile = Files
.GroupBy(x => x.Timestamp)
.Last()
.ToArray<JournalFile>()
.OrderBy(x => x.Timestamp)
.Last()
;
return lastfile;