Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private nf As AHNumeric
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
nf = SetFormatChars("~", ":")
Log(nf.Format(1000000.3434))
End Sub
Sub SetFormatChars(Grouping As Char, DecimalSeparator As Char) As AHNumeric
Dim loc As AHLocale
loc.InitializeUS
Dim jloc As JavaObject = loc
jloc = jloc.GetField("myLocale")
Dim nfs As AHNumeric
nfs.InitializeNumber2(loc)
Dim r As Reflector
r.Target = nfs
Dim dfs As JavaObject
dfs.InitializeNewInstance("java.text.DecimalFormatSymbols", Array(jloc))
dfs.RunMethod("setGroupingSeparator", Array(Grouping))
dfs.RunMethod("setDecimalSeparator", Array(DecimalSeparator))
Dim jo As JavaObject = r.GetField("mNumberFormat")
jo.RunMethod("setDecimalFormatSymbols", Array(dfs))
Return nfs
End Sub