Jump to content

This topic is 8393 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi,

I am trying to write a timing system which will allow the timekeepers to enter the times in Hours:Minutes:Seconds:Hundredths Of Seconds. It all works fine except for the "Hundredths of Seconds" part which I cannot work out how to include. Any ideas/experiences appreciated.

Thanks

Roger

Posted

Any reason you can't just use a number field to enter the hundredths? Maybe you could give us more detail about how this info will be acquired and used, and what exactly is the difficulty you're having. Do you need to add the times? Remember you can extract and assemble parts of times with the Hours(), Minutes() and Seconds() functions. They are just numbers, after all.

Posted

Roger,

Have just done the first race with a system which does just what you're asking. The time you're entering needs to be converted into seconds and hundredths of a second for any calculations. All your sorts, placings etc can be done with raw seconds. Then you need to have a calc which converts the resultant seconds back to a h:mm:ss.ss text format for display.

From your entry to seconds = hh*3600 + mm*60 + ss + .ss/100 (assumes you have four entry fields for the time groups.

To go the other way depends on how you want to display the result. Getting rid of unnecessary zeros takes the most steps. I used this calc to get the final result in a text format of hh:mm:ss.ss with leading zeroes and unnecessary ":" separators removed.

for a resultant number of seconds "Time for this lap secs"...

If(Time for this Lap secs >= 3600,TimeToText(Time for this Lap secs),If(Time for this Lap secs >= 600,Right(TimeToText(Time for this Lap secs), 5),Right(TimeToText(Time for this Lap secs), 4)))&"."&If(Int(Time for this Lap secs)=Time for this Lap secs,"00",If(Time for this Lap secs-Int(Time for this Lap secs)<.10,"0"&NumToText(Round(100*(Time for this Lap secs-Int(Time for this Lap secs)),0)),NumToText(Round(100*(Time for this Lap secs-Int(Time for this Lap secs)),0))))

This also gets around the accuracy limits where sometimes 20 hundredths of a second may come out as 0.199999999

You could also use the TimeToText function to convert whole seconds to hh:mm:ss and then add the appropriate decimal suffix text based on your hundredths. But this will not have the unnecessary zeroes and ":" trimmed.

If you want to send me a PM I can email you a couple of FMP5 examples.

Russ Baker

Canberra, Australia

This topic is 8393 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.