Prevent Timer from droping zero after reaches below 10 seconds

When the timer counts down below 10 seconds it drops the leading zero and just goes down to one number. I am wanting it to to say like "09"“08” exc exc.

using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class Timer : MonoBehaviour {
 
     public TextMesh timer;
     float minutes = 5;
     float seconds = 0;
     float miliseconds = 0;
         
          void Update()
     {
 
         if (miliseconds <= 0)
         {
             if (seconds <= 0)
             {
                 minutes--;
                 seconds = 59;
             }
             else if (seconds >= 0)
             {
                 seconds--;
             }
 
             miliseconds = 100;
         }
 
        miliseconds -= Time.deltaTime * 100;
 
         //Debug.Log(string.Format("{0}:{1}:{2}", minutes, seconds);
         timer.text = string.Format("{0}:{1}", minutes, seconds);
     }
   }

There may be a more elegant approach, but prepending a zero on seconds if it’s below 10 worked. I changed your last line with timer.text =… to this:

        if(seconds < 10) {
            timer.text = string.Format("{0}:{1}", minutes, "0" + seconds);
        } else timer.text = string.Format("{0}:{1}", minutes, seconds);

Let me know if this works.