NUMBER Input Type

Ricky D

Well-Known Member
Licensed User
Longtime User
If I choose NUMBER or NUMBER_DECIMAL as the input type of an EditView I can't enter -ve numbers like -89.70

How can this be made to work?

The soft keyboard shows the - sign but doesn't put it in the editview

regards, Ricky
 

JonPM

Well-Known Member
Licensed User
Longtime User
A couple of my apps have EditText's that use DECIMAL_NUMBERS and I am able to input a negative number using -
I'm not sure why it's not working for you.
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
doh!

gee some of the silly things I do...

I'm using this

B4X:
Sub tAmount_FocusChanged (HasFocus As Boolean)
   If HasFocus=True Then
      tAmount.SelectAll 
      IME.SetCustomFilter(tAmount,tAmount.INPUT_TYPE_NUMBERS,"0123456789.")
      IME.ShowKeyboard(tAmount)
   Else
      LoadingActivity = True
      tAmount.Text = u.FixDouble(tAmount.Text)
      LoadingActivity = False
      IME.HideKeyboard 
   End If
End Sub

I'm limiting what can be typed there

changing it to

B4X:
Sub tAmount_FocusChanged (HasFocus As Boolean)
   If HasFocus=True Then
      tAmount.SelectAll 
      IME.SetCustomFilter(tAmount,tAmount.INPUT_TYPE_NUMBERS,"0123456789.-")
      IME.ShowKeyboard(tAmount)
   Else
      LoadingActivity = True
      tAmount.Text = u.FixDouble(tAmount.Text)
      LoadingActivity = False
      IME.HideKeyboard 
   End If
End Sub

fixes it :eek:

silly me

regards, Ricky
 
Upvote 0
Top