Skip to content

Commit

Permalink
Manager: Corrected log duration to display 1m 00.0s instead of 0m 60.0s
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkaaaaa committed May 7, 2024
1 parent 0b693b2 commit 43f8599
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ArcdpsLogManager/Sections/LogList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,20 @@ private GridView<LogData> ConstructLogGridView(LogDetailPanel detailPanel, Multi
return "?";
}
var seconds = x.EncounterDuration.TotalSeconds;
return $"{(int) seconds / 60:0}m {seconds % 60:00.0}s";
var separator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
var totalSeconds = x.EncounterDuration.TotalSeconds;
var minutes = (int)totalSeconds / 60;
var seconds = (int)totalSeconds % 60;
var milliseconds = (int)((totalSeconds - Math.Floor(totalSeconds)) * 1000);
if (minutes > 60)
{
var hours = minutes / 60;
minutes -= hours * 60;
return $"{hours}h {minutes:0}m {seconds}{separator}{milliseconds.ToString()[0]}s";
}
return $"{minutes:0}m {seconds}{separator}{milliseconds.ToString()[0]}s";
})
}
};
Expand Down

0 comments on commit 43f8599

Please sign in to comment.