How to Dynamically alter the Timer Field Based on mm:ss to hh:mm:ss

I'm seeking a bit of help here.. I would want to replicate a native garmin behaviour in the Timer field.
I would like to go from mm:ss to h:mm:ss (but I would like the Hour to be a superscript much like what the picture below shows)



However, I'm currently having a tough time trying to figure out if this is doable w/o resorting to some code kung-fu (which I clearly do not have).

Previously - I am able to get this done thru sub-scripting the h:mm:ss and then doing
dc.drawtext(xxx,yyy,"hour component",justity_left)
dc.drawtext(www,zzz,"mm:ss component",justity_left)


but right now, my code calls and returns it as such

if (TTSec > 3600) {
TTMin = (TTSec/3600) + ":" + ((TTSec % 3600) / 60);
} else {
TTMin = (TTSec / 60) + ":" + (TTSec % 60);
}
}
return TTMin;


the return just returns the entire h:mm:ss or mm:ss depending on if i'm > 3600 seconds.
and the draw text component just does

dc.drawText(150, 128, Gfx.FONT_NUMBER_MEDIUM,populateDataField(DSArray[6][2],info), Gfx.TEXT_JUSTIFY_CENTER);


and since i would not now which Fields (there are 9) the user would select, I do not want to pepper the code w/ a bunch of if statements and bloat the code to check which of the 9 fields is calling for Timer Field and then formatting it as needed. I'm already near my 64kb memory limit - so code bloat is not something I want to do.
  • in your return, how about instead of just returning the sting, you return an array of two strings? The first string being "mm:ss", and the second being "h", (or "" if hour is zero.) Display the two stings all the time with the hours being superscripted or whatever, and in the case of 0 hours, nothing shows, without doing any checks outside of the routine where the time is generated.

    For non-timer data returns, the second string would always be "".
  • That's possible but still does not enable me to determine which of the 9 fields the "user" has opted to put the hh:mm:ss field. (hence needing to check each and ecery of the 9 fields and put in 2 level drawtext for every one)

    That's the only thing I can think of unless there is some other magic.