Android Question How to Use Negative Numbers in a B4XPlusMinus

bocker77

Active Member
Licensed User
Longtime User
The documentation for B4XFormatter is blank, https://www.b4x.com/android/help/b4xformatter.html, so I have nothing but an example from Erel to go by which I am not sure I understand it. Anyway I am wondering what the RemoveMinusSign does. It is not in his example.

Here is what I got but when I run it the number in the B4XPlusMinus range field is blank.

B4X:
    pmInput2.Formatter.GetDefaultFormat.MaximumFractions = 0
    pmInput2.Formatter.GetDefaultFormat.MinimumFractions = 0
    pmInput2.Formatter.GetDefaultFormat.RemoveMinusSign = False
    Dim strLow As String = pmInput2.Formatter.Format(-80)
    Dim dLow As Double = strLow
    Dim strHi As String = pmInput2.Formatter.Format(-86)
    Dim dHi As Double = strHi
    pmInput2.SetNumericRange(dLow, dHi, 1)

Private Sub pmInput2_ValueChanged (Value As Object)
    strNewLon = pmInput2.Formatter.Format(Value)
End Sub

Thanks
 

stevel05

Expert
Licensed User
Longtime User
On the basis that -86 is lower than -80, try switching the values.
 
Upvote 0

bocker77

Active Member
Licensed User
Longtime User
I am working with Decimal Degrees DDDs and I guess I just didn't think of that. But I should have. Thanks again.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Ha, we've all done it. when you are looking too hard, it get's to the stage where you can't see anything.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

bocker77

Active Member
Licensed User
Longtime User
Okie dokie. I stumbled across a link to that documentation during a search when not finding anything under a library explanation. Thanks for the heads up.
 
Upvote 0
Top