LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric time indicator with one digit for the hour

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.

format.png

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?

0 Kudos
Message 1 of 3
(958 Views)

I did this a long time ago to go with my countdown timers...

 

TimeString.png

 

But I swear there is a better way as I haven't used this sub-vi in ages, but it escapes me now...


========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 3
(949 Views)

numtext.format.png

 

so, this is all about getting rid of the first leading zero in the hours-string?

0 Kudos
Message 3 of 3
(928 Views)