I need to make two masks for input text...
one for currency and other one for date ...
but i can't do this...
Someone can help me?
ps: sorry for my english ... I'm brazilian
one for currency and other one for date ...
but i can't do this...
Someone can help me?
ps: sorry for my english ... I'm brazilian
B4X:
Sub EditText1_TextChanged (Old As String, New As String)
Dim Saida As String
Dim res As String
Dim pos As Int : pos = 0
Saida = New.Replace(".","")
res = New
' If Saida.Length < 3 Then
' res = Saida.SubString(2) & "." & Saida.SubString(2)
' End If
If Saida.Length >= 4 Then
Saida = Saida.Replace(",","")
res = NumberFormat(Saida,0,1)
res = res.Replace(",",".")
EditText1.SelectionStart = Saida.Length + pos
pos = 1
End If
If New <> Old Then
EditText1.Text = res
EditText1.SelectionStart = Saida.Length + pos
End If
End Sub