Android Question Edit String

tufanv

Expert
Licensed User
Longtime User
Hello

I use dateutils to find remaining time to another time with period:

B4X:
kalan(3).Text ="Remaining Time : " &  t.Hours&":"&t.Minutes&":"&t.Seconds

My problem is lets say 12 hours 8 minutes and 42 seconds left : It prints liek this :

12:8:42 . I want it to be 12:08:42 ( it is same for the hour and second also i I also want to display them like than when it is 1 digit )

Any way to do this ?

TY
 

DonManfred

Expert
Licensed User
Longtime User
Use Smart String-Literal

Something like
B4X:
$"Remaining Time :$2.0{t.Hours}:$2.0{t.Minutes}:$2.0{t.Seconds}"$
 
Upvote 0
Top