Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.
Users reporting for no reason may be locked out.
Kyle Heyer wrote:If you click the link posted by Nick, you see a script of mine where I used a function to convert the exact same thing that you are looking for:
Hi all,
Does anyone know how to properly format lap times in a script?
returning the FastestLapTime binding will give 71.xxx instead of 1:11.xxx - the only way I currently know how to format any sort of label binding like this is to do FastestLapTime.ToString("0.000").
What's the proper way to do this?
Thank you!
Kyle
// If the car is in the same lap just return the time
// If the car is in same lap but over a minute behind, convert total seconds to proper format
var min = 0;
float sectime;
if (gap > 60)
{
min = (int) (gap / 60);
sectime = gap % 60;
return "+" + min + ":" + sectime.ToString("00.000");
}
else
return "+" + gap.ToString("0.000");