Help with RTC block in UIFlow / Blocks
-
Im looking to show the time using the RTC blocks, when I show minutes (under 10 min) the minutes show as one digit, i.e. '2', rather than '02'. Is there a way (using blocks) to show time (hours and minutes) as two sets of double digits? ie. '01:01' not '1:1'
-
You have to do it one character at a time, using “first letter” and “last letter”. For example (in the if/do/else block):
In C or Python code of course you’d just use sprintf() or the equivalent.
-
@wsanders Thats awesome, thank you!
I was thinking that I could use an If statement...so if the minute value was less than 10 (say), you add '0' to the front of the number, same with the hour etc.
-
Huh ?
This shows it in the format you want