Bug? NumberFormat2 does not take into account locale in B4A 8.0

tomazc

Member
Licensed User
Longtime User
Hi,
after upgrade to B4A 8.0, NumberFormat2 doesn't take into account locale number format.

B4X:
Dim joBA As JavaObject
joBA.InitializeStatic("anywheresoftware.b4a.BA")
Dim joNF As JavaObject
joNF.InitializeStatic("java.text.NumberFormat")
Dim ref As Reflector
ref.Target = ref.CreateObject2("java.util.Locale", Array As Object("sl"), Array As String("java.lang.String"))
NFSlo = joNF.RunMethod("getInstance", Array As Object (ref.Target))
joBA.SetField("numberFormat", NFSlo)

'Test:
Log(NumberFormat(2131231231.123456, 1, 2))
Log(NumberFormat2(2131231231.123456, 1, 2, 2, True))

Result:
2.131.231.231,12
2,131,231,231.12
 
Last edited:
Top