Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on May 31, 2024 3:26PM
Likes: 0
Replies: 4
I have a column called minutes and that can range from 0 - 60, what I'm trying to do is add a leading 0 to the single digit values,
ex 9 = 09, so that no matter what my value is always 2 digits long, is that possible? and if so, how would I accomplish that?
Operating system used: windows
You have not responded to my answer in your other thread which seems to be related to this. Perhaps you are trying to calculate the difference between two dates and display the result in hh:mm:ss format? This 6 year old post shows how to do that.
That formula didnt work for me
You need to make sure you don't break the formula lines in the wrong place. Try with this text which uses a code block and should add extra line breaks:
"00"[0,2-(floor(diff(last_working_day, Date_parsed, "seconds")/3600)).length()] + (floor(diff(last_working_day, Date_parsed, "seconds")/3600)) + ':' + "00"[0,2- (floor(mod(diff(last_working_day, Date_parsed, "seconds"), 3600)/60)).length()] + (floor(mod(diff(last_working_day, Date_parsed, "seconds"), 3600)/60)) + ':' + "00"[0,2- (mod(mod(diff(last_working_day, Date_parsed, "seconds"), 3600),60)).length()] + (mod(mod(diff(last_working_day, Date_parsed, "seconds"), 3600),60))
Also this formula can add leading zeros as required:
concat(("00" + Hours).substring(-2), ":", ("00" + Minutes).substring(-2))