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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
techpr0Author Commented:
figured out myself
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apple Networking

From novice to tech pro — start learning today.