Android Question Custom numeric format strings

DonManfred

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

Blueforcer

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

Erel

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

AHLocale library adds more options: https://www.b4x.com/android/forum/threads/ahlocale-library.7561/#content

And you can always format it yourself:

B4X:
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
Top