Report post

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.


Post

Posted by Simon Grossmann
on
This is what we use internally for custom themes to convert gaps:
internal static string ConvertToTimeString(this float seconds, string secFormat = "0.000", bool withMinutes = true, string prefix = "", string def = "")
{
if (seconds <= 0)
return def;

var min = 0;
float sectime;
if (withMinutes)
{
min = (int) (seconds / 60);
sectime = seconds % 60;
}
else
{
sectime = seconds;
}

var sb = new StringBuilder(prefix);
if (min > 0)
sb.Append(min).Append(':').Append(sectime.ToString("0" + secFormat));
else
sb.Append(sectime.ToString(secFormat));

return sb.ToString().Replace(',', '.');
}