GUI Text Values keep resetting

I am trying to display through GUI text the amount of calories burned riding a bicycle relative to the amount of time spent riding the bike. The code I have works except for the fact that it resets back to zero every 60 seconds. I can't for the life of me figure out what's wrong. Here's the code that I am using below.

//Format the time nicely

guiText.text = FormatTime (); guiText.material.color=Color.white;

}

//Format time like this

//12(minutes):34(seconds).5(fraction)

function FormatTime () {

var intTime = Time.time;

var seconds = intTime % 60;

switch (vehicle) { case "car" : calories = seconds * .03317; break; case "bike": calories = seconds * .1325; break; case "walk": calories = seconds * .058; break; default: //don't do anything! break; }

calories = Mathf.Floor(calories * 100) / 100;

//print (calories);

            //if seconds are under ten, add a zero

            if (calories < 10) {
                            caloriesText = "0" + calories.ToString();

            } else {

                            caloriesText = calories.ToString();

            }

return caloriesText;

}

Any help would be appreciated!

You're telling it to reset to 0 every 60 seconds when you use the modulus operator: "var seconds = intTime % 60;". However, most of that actually isn't necessary; you're better off just using string formatting:

function FormatTime () {
    switch (vehicle) {
        case "car" : calories = Time.time * .03317; break;
        case "bike": calories = Time.time * .1325; break;
        case "walk": calories = Time.time * .058; break;
        default: //don't do anything!
        break;
    }
    return calories.ToString("00.00");
}