Android Question Specify thousands separator?

Discussion in 'Android Questions' started by Roger Daley, Dec 17, 2016.

  1. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Hi All,

    I have been searching for a way for the user to specify/select their preferred separator in decimal numbers. IE Thousands separator can be comma-dot-space or none.

    This has been asked in the distant past but I see no real solution.

    Regards Roger
    Last edited: Dec 20, 2016
  2. DonManfred

    DonManfred Expert Licensed User

  3. Erel

    Erel Administrator Staff Member Licensed User

    Depends on AHLocale, Reflection and JavaObject libraries:
    Sub Process_Globals
    Private nf As AHNumeric
    End Sub

    Sub Globals

    End Sub

    Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
         nf = SetFormatChars(
    End If
    End Sub

    Sub SetFormatChars(Grouping As Char, DecimalSeparator As Char) As AHNumeric
    Dim loc As AHLocale
    Dim jloc As JavaObject = loc
       jloc = jloc.GetField(
    Dim nfs As AHNumeric
    Dim r As Reflector
       r.Target = nfs
    Dim dfs As JavaObject
    Dim jo As JavaObject = r.GetField("mNumberFormat")
    Return nfs
    End Sub
  4. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Thanks Erel,

    It looks like what I need. Perhaps we could add Numberformat3 to the wish list. Several dedicated options and auto-locale.

    Regards Roger
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice