Android Question Format a text

sultan87

Active Member
Licensed User
Longtime User
Hello
I want to format a field
example
for i = 1 to 15
= 1 if text = "01" i
if = 9 text = "09" i
if = 13 text = "13" i

something like in vb text = Format (i, "00")

Best regards
 

stevel05

Expert
Licensed User
Longtime User
Search the forum for NumberFormat / NumberFormat2
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
This is to follow up with Steve's tip:
B4X:
For i=1 To 15
    Log(FormatNumber(i, 2, 0 ))
Next

Sub FormatNumber(x As Int, MinInt As Int, MaxFrac As Int ) As String
   Return NumberFormat(x,MinInt,MaxFrac)
End Sub
 
Upvote 0

sultan87

Active Member
Licensed User
Longtime User
thank you to both
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…