Android Question convert number

Almora

Active Member
Licensed User
Longtime User
1.542.500 >>> 1542.500

How can I convert this number to this shape?
I want to convert it into actionable.
thanks..
 

Mahares

Expert
Licensed User
Longtime User
Here are two ways, but there are others:
B4X:
Dim s As String ="1.542.500"
    Dim d As String = NumberFormat2(s.Replace(".","")/1000,1,3,3,False)
    Log(d)

B4X:
 Dim s As String ="1.542.500"
    Dim sarray() As String = Regex.Split("\.", s)
    Log($"${sarray(0)}${sarray(1)}.${sarray(2)}"$)
There are other ways like regex and B4XFormatter
 
Upvote 1
Top