import Foundation

extension TimeInterval {
    /// Converts the interval (in seconds) to a string formatted as M:SS
    func toMinuteSecondString() -> String {
        // Round to nearest whole second (or use Int(self) to floor)
        let totalSeconds = Int(self.rounded())
        let minutes = totalSeconds / 60
        let seconds = totalSeconds % 60
        return String(format: "%d:%02d", minutes, seconds)
    }
}
