These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to convert minutes to hours in a fillable PDF file

artista10
Registered: Jan 30 2009
Posts: 2

Hi. Does anyone know how to have an interactive file where user enter hours and minutes, (In a timesheet, week period, for example) and there is a total field that updates automatically as follows?

1:45 + 2:50 SHOULD EQUAL 4:35 NOT 3.95
(I have to convert minutes (over 60) to hours)

Basically, minutes how to convert to hours when going over 60 minutes.

I am thinking that it might require some scripting (Java?) to do that?

My product information
Acrobat Pro9

Milton

My Product Information:
Acrobat Pro 9.0, Macintosh
Peterburger
Registered: Mar 15 2008
Posts: 12
Multiply 1. and 2 with 60
then add those and 45 and 50 (60 + 120 + 45 + 50 = 275)
and the gained sum dived by 60 (275 / 60 = 4,583333...)
take the 4 to some variable (varA)
and the dividend multiply with 60 (0,583333... * 60 = 35)
take this 35 to some varB

This kind of procedure is called also as Mathematics...
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
There are a number of possible ways. The easiest is to use the ".split()" method to get the hour and minutes from the character string and then process the hours and minutes as necessary to obtain the correct values of hours and minutes and then build the correct character string for display.

George Kaiser