Sub EditText1_TextChanged (Old As String, New As String)
Dim sb As StringBuilder
sb.Initialize
Dim Clean As String = New.Replace(",", "")
Dim DecimalSeparatorIndex As Int = Clean.IndexOf(".")
If DecimalSeparatorIndex > -1 Then
sb.Append(Clean.SubString(DecimalSeparatorIndex))
Clean = Clean.SubString2(0, DecimalSeparatorIndex)
End If
For i = 0 To Clean.Length - 1
If i Mod 3 = 0 And i > 0 Then
sb.Insert(0, ",")
End If
sb.Insert(0, Clean.CharAt(Clean.Length - 1 - i))
Next
If sb.ToString <> New Then
EditText1.Text = sb.ToString
EditText1.SelectionStart = EditText1.Text.Length
End If
End Sub