Any level ideas?
using System.Collections; using System.Collections.Generic; using UnityEngine; using System; public class TimeFormatter : MonoBehaviour { public static string FormattedText(float seconds) { if(seconds <= 0) { return "00:00"; } string formattedText = ""; string formattedHours = ""; string formattedMins = ""; string formattedSecs = "00"; if(seconds == 0) { return "00:00"; } if(seconds % 60 != 0) { float secs = seconds % 60; if(secs >= 10) { formattedSecs = Math.Truncate(secs).ToString(); } else { formattedSecs = "0" + Math.Truncate(secs).ToString(); } } if(seconds % 3600 != 0) { float cleanMins = seconds % 3600; float mins = cleanMins / 60; if(mins >= 10) { formattedMins = Math.Truncate(mins).ToString(); } else { formattedMins = "0" + Math.Truncate(mins).ToString(); } } if(seconds >= 3600) { float hours = seconds / 3600; formattedHours = Math.Truncate(hours).ToString(); } if(formattedHours != "") { formattedText = formattedHours + ":" + formattedMins + ":" + formattedSecs; } else { formattedText = formattedMins + ":" + formattedSecs; } return formattedText; } }