namespace DeepDrftPublic.Client.Helpers; /// /// Formats a runtime expressed in seconds as a compact hh:mm string for the home hero stat row. /// Hours are not zero-padded and may exceed two digits (mixes are few, so a large total simply renders /// "123:45"); minutes are always two digits. Negative or non-finite inputs clamp to "0:00". /// public static class RuntimeFormat { public static string ToHoursMinutes(double totalSeconds) { if (double.IsNaN(totalSeconds) || double.IsInfinity(totalSeconds) || totalSeconds <= 0) return "0:00"; var total = TimeSpan.FromSeconds(totalSeconds); var hours = (int)total.TotalHours; return $"{hours}:{total.Minutes:D2}"; } }