Convert time to decimal in Filemaker

I need to convert a field that looks like this 4:29 to 4.29 in a filemaker script for all records. i have it stored as a number in the database.

it would be basically
3:00 to 3
3.20 to 3.2
11:29 to 11.29
techpr0Asked:
Who is Participating?
 
jvaldesCommented:
You don't need a script to do this, sorry I forgot to say that. This could be a calculated field

If you needed it in script, you should use the
Set Field(Dec,time,Hours(YourTime)&"."&int(Minutes(YourTime)/60*100
as a line in your script
0
 
jvaldesCommented:
If you need to convert without proportioning to decimal then use the following:

DecTime=Hours(YourTime)&"."&Minutes(YourTime)   this will provide 4.29 for 4:29

If you need it in pure decimal then:

DecTime=Hours(YourTime)&"."&int(Minutes(YourTime)/60*100) This will provide 4.49

Where YourTime is your time field name
0
 
techpr0Author Commented:
how do you write this in filemaker pro 9 script scriptmaker
0
 
jvaldesCommented:
Create a field on the table "DecTime", Use the calculation type and make sure you choose the text for result for the field and add the lines above to the calculation. Make sure you use your field that contains the time now.

And the DecTime field will contain your new representation.
0
 
techpr0Author Commented:
figured out myself
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.