Computing time using Client script

Chella_sundar26
Tera Contributor

We have a form on the portal where the user adds the time spent for a week. When computing the hours spent for the week, the total hours field is ignoring the zero that precedes the final value. For an example instead of displaying 3 hours and 3 mins as 3:03 , the final value is displayed as 3:3 . This is occurring only when there is a zero preceding the minutes .

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, without any details of your code the community can only guess at the underlying issue. I would suspect that the time is returned as a numeric value in your calculations and so the leading does not exist? Depending on your configuration you could stringify and thensubstring out the minutes value, check it's length, add 0 if required and the concatenate or replace() the substring with the 'new' value.