Avatar

Level 1

Hello Gene-O

Don't take this the wrong way.... buuuut your problem is in your math.  1.15 is not equal to 1 hour and 15 minutes.  1.25 is equal to 1 hour 15 minutes. 165/60 does equal 2.75 hours. 

You are trying to get this type of time:  1:15 (1 hour 15 minutes - notice the colon)

You actually have to do a conversion and then re-convert it back to

I have a form with columns of time in this format HH:MM (hours are seperate column & minutes are a seperate column.)

 

var dMin = Page1TotalMinutes      (Page1TotalMinutes is a seperate formula in a different cell in the table)

var dHrs = Round (dMin / 60, 2)

dMin = Round( Mod(dHrs, 1) * 60)

$.formattedValue = Concat(dHrs, ":", dMin)

if (dMin <=9) then    

     $.formattedValue  = Concat(dHrs, ":0", dMin) 

      elseif (dMin >=10) then

      $.formattedValue = Concat(dHrs, ":", dMin)

endif

     

  

If you didn't want to use multiple cells for your formula, I could've made my Page1TotalMinutes another variable in the above code like this

var Page1TotalMinutes = sum (HoursTotal1 + MinutesTotalPage1) (But again I have HoursTotal1 & MinutesTotalPage1 in different cells that could be made into yet another variable like I did above)

Message was edited by: JillOfAllTrades72 @3:15 on 9/11/13