Android Question Custom numeric format strings


Licensed User
Longtime User
Microsoft docs are not relevant in Android. Search Android docs for any relevant Info.
Upvote 0


Well-Known Member
Licensed User
Longtime User
Of course i know its not relevant. Im searching for a similar possibility. The given Link is just to show my needs.

I didnt find anything about android, but maybe someone has reprogrammed something similar here.
Upvote 0


B4X founder
Staff member
Licensed User
Longtime User
The standard way to format numbers is with NumberFormat or NumberFormat2.

AHLocale library adds more options:

And you can always format it yourself:

Sub StrangeFormatNumberWithDot (n As Float) As String
   Dim s As String = NumberFormat2(n, 1, 0, 0, False)
   If s.Replace("-", "").Length >= 3 Then s = s.SubString2(0, s.Length - 2) & "." & s.SubString(s.Length - 2)
   Return s
End Sub
Upvote 0