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

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đ
Register Login