Hello,
I have a customer who wants a form to have a time field where the user inputs something like 03:15:00 to indicate that they worked on something for 3 hours and 15 minutes. Then, we want to calculate a labor charge using that time field and a static value - $60 in this case. Is there a way to take the value in the time field, basically turn it into 3.25 (in this example), and then use that value in a formula?
Thanks!
Question
Question
Forms - Multiplication formula with a time field
Answer
The TIMEVALUE formula is used to convert time strings to datetime elements, basically a decimal of a day. If you then multiple that by 24, you'll get a decimal of hours. Example:
=TIMEVALUE(time_variable)*24
I tested this on the Classic designer in Version 11.0.2212.30987 with 03:25:00 from the time_variable field into a number field set to 3 decimal places, and it gave me 3.250.
P.S. Please consider editing your post and changing it to a question instead of a discussion so that you can mark it as answered (once you are happy with the answer).
Replies
Hello, in my opinion, the time field wouldn't work, based on how the time field displays. (see screenshot below)
You could create a starting time and ending time, using time fields, and then calculate the time and multiply that by the 60, kind of a long the lines of this post.
https://answers.laserfiche.com/questions/182056/Calculating-Working-Hours--Timesheet#182067