Bug? NumberFormat2() changes NumberFormat() behaivior

Gustavo Retana

New Member
Licensed User
Longtime User
Just for causality I used both NumberFormat and NumberFormat2 in the same code and I noticed that when I change the Grouping parameter in NumberFormat2, NumberFormat starts behaving accordingly with the parameter in NumberFormat2. If I set the Grouping as False in NumberFormat2, NumberFormat stopped grouping the numbers, if I set the Grouping back to True then NumberFormat starts grouping the numbers.

The documentation does not say nothing and I could not find any reference to this issue somewhere else so I really do not know if this is a BUG o this is how it suppose to behave.

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")

Dim a As Double

a=1234567.1234567

Log("1) NF grouping   :" & NumberFormat(a,1,12))
Log("2) NF2 False     :" & NumberFormat2(a,1,12,0,False))
Log("3) NF NoGrouping?:" & NumberFormat(a,1,12))
Log("4) NF2 True      :" & NumberFormat2(a,1,12,0,True))
Log("5) NF grouping   :" & NumberFormat(a,1,12))

End Sub

ejemplo.png
 
Top