I need my form to calculate the procedure duration and display it as a note after staff have keyed in procedure start and end times. currently I gives me 0 as the output which is not correct. is there something I need to do differently? any suggestions will be appreciated. an excerpt of my form is below
begin group pro_duration field-list
time procedure_start_time 4. Time the circumcision procedure started (HH:MM:SS): yes
time procedure_end_time 5. Time the circumcision procedure ended (HH:MM:SS): yes
end group
calculate pro_dur ${procedure_end_time}- ${procedure_start_time}
acknowledge note11 The procedure duration is: ${pro_dur}
Thanks @Xiphware this solves. I thought it would display the minutes but it doesn't so I divided the value by 1440 to get the duration displayed in minutes. thanks so much for the insight.
@Xiphware Sorry to bring this up again but I need a little help still, hope you won't mind. Is it possible to round off a calculate output in the xlsform say to 2 decimal places, or must one have to edit the xml file? Thanks once again.
Hi @dicksonsamwel, Thanks for pointing that out, I had seen the function and tried it out but seemingly I didn't get it right (still on the learning curve with xml) any help will be appreciated. below is the section of the form
Just a short note to say I was having a similar issue, and delighted to see the solution so helpfully already provided here on the forum. Thank you @dicksonsamwel !