>>Hi all,
>>
>>Real basic formula needed for calculating a time per mile.
>>
>>For instance, if I ran 10.5 miles in 1hr 10min and 15 seconds, what is the proper way to calculate the per mile time? I have come up with a simple calculation but It's not always reporting the correct minute/secs per mile.
>>
>
>I'd convert to seconds, compute in seconds, and convert back.
>
>nNumSecsElapsed = (3600 * nNumHrs) + (60 * nNumMins) + nNumSecs
>#DEFINE SECSPERHR 3600 && 60 * 60
>nTimePerMileInSecs = (nNumSecsElapsed /(nDistInMiles * SECSPERHR)
Too early in the morning, and overly complicated. The line above should be:
nTimePerMileInSecs = nNumSecsElapsed/nDistInMiles
>? TTOC({^1999-01-01 0:0} + nTimePerMileInSecs,2)
>
>>Any ideas?
>>
>>Thanks.
>>
>>John.