08-10-2021 03:08 PM
I have a numeric indicator being fed a single that is how long in second an elapsed time is.
I would like to display this as a time in the format of H:MM:SS (so the hour display is only one digit). I can easily get HH:MM:SS format but not what I really want. Ideally the hour field would continue the behavior in relative time where hour overflow just keeps growing the digits to fit.
so 10000 input would give 2:46:40
and 100000 would give 27:46:40
and 1000000 gives 277:46:40
I could be ok with hr just always being 1 significant digit as I will likely never go over 9:59:59
I find the same behavior where I always get at least 2 hr digits using Format Into String or Format Date/Time String
I found a way of getting a string that is the way I want but it is a bit of a pain.
I have to make a string indicator that looks like the numeric did. It is just a shame to do all of that when the built in formatting function is so close.
Is there something I am missing?
08-10-2021 03:39 PM - edited 08-10-2021 03:40 PM
I did this a long time ago to go with my countdown timers...
But I swear there is a better way as I haven't used this sub-vi in ages, but it escapes me now...
08-10-2021 04:46 PM - edited 08-10-2021 04:50 PM
so, this is all about getting rid of the first leading zero in the hours-string?