This code will extract the number (assuming you always use commas as a delimiter)
B4X:
Sub Spin_ItemClick(Position As Int, Value As Object)
Dim Digits As String
Digits = Value
Digits = Digits.SubString2(0, Digits.IndexOf(","))
Msgbox(Digits, "")
End Sub
Sub SpnAccount_ItemClick(Position As Int, Value As Object)
Dim Digits As String
Digits = Value
Digits = Digits.SubString2(0, 1)
EditText2.text = Digits
End Sub
Just in case you wish to avoid the indexing in front of the spinner's items, you can populate a list with these numbers, then get them by using the position value of the itemClick Event.
B4X:
sub globals
dim ls as list
...............
populate sub
ls.initialize
ls.add("1")
ls.add("2")
.............
sub ...ItemClick(...)
edittext2.text=ls.get(position)
..............
This can become a solution, in cases where the ids are 'ugly' numbers.