Android Question NumberFormat2 difference in B4A 7.3 and 8.0

tomazc

Member
Licensed User
Longtime User
Hi,
the following code:
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"))
Dim NFSlo As Object
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))

produces "wrong" result in B4A 8.0 for NumberFormat2

Result B4A 8.0:
2.131.231.231,12 (ok)
2,131,231,231.12 (wrong)

Result B4A 7.3:
2.131.231.231,12 (ok)
2.131.231.231,12 (ok)
 
Last edited:
Top