| 12345678910111213141516 |
- using System;
- using System.Globalization;
- namespace DevilLink2.UI
- {
- public static class HudFormatting
- {
- // Matches the final HTML updateTimer: ceil first, then minutes/seconds.
- public static string Time(bool hasTimer, double remaining)
- {
- if (!hasTimer) return "∞";
- long seconds = (long)Math.Ceiling(Math.Max(0, remaining));
- return (seconds / 60).ToString("00", CultureInfo.InvariantCulture) + ":" + (seconds % 60).ToString("00", CultureInfo.InvariantCulture);
- }
- }
- }
|