Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

how to roundup time calculation to nearest hour?

$
0
0

Hi,

 

I'm trying to round up a calculation result to the nearest hours

for example, I want the result: 4:49 to be 5

 

I have the a start time field and an endtime field and the a totalhours field which I have managed to get to work using the following script:

var startT = StartTime.formattedValue

var endT = EndTime.formattedValue

var differenceT = Time2Num(endT, "HH:MM") - Time2Num(startT, "HH:MM")

 

$ = Num2GMTime(differenceT, "H:MM")

 

However, the output is coming up as:

ss.jpg

4:59, when I want it to just say 5

 

Any help here would be greatly appreciated.

 

Please note, I have a very basic knowledge of this scripting just by searching the web, so baby steps would be really appreciated. Thank you :-)


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>