Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
565
Format a double as an elapsed time as mm:ss.fff
posted

I have a field representing an elapsed time in seconds.  I can't see to find a way to format the string as mm:ss.fff,  In c# I'd just use Timespan.FromSeconds and use format to get what I;d like.

I'm looking for an report expression equivalent of:

static public string FormatLapTime(double timeInSeconds)

{
TimeSpan t = TimeSpan.FromSeconds(timeInSeconds);

return string.Format("{0:D2}:{1:D2}.{2:D3}", t.Hours * 60 + t.Minutes, t.Seconds, t.Milliseconds);
}

Each record in my table has an elapsed time.  Each elapsed time is made up of several segments, each with their own elapsed time.  Ideally I'd like to use the reporting tool to help determine the maximum elapsed time for each segment, sum them together and display the potential longest time in the mm:ss.fff format, as detailed above.

Any ideas on how to make this happen?

Parents Reply Children
No Data