the number is this : 123456789.987654321
How can make this format (only main part of number) 123,456,789.987654321
I mean to dont touch decimal numbers XXX,XXX,XXX.987654321
I tought to put comma every 3 digits I found this code but not work in all number.length and also with decimal number
I found this Codes but not work when number lenght is longer and if Decimal numbers inqluded.
What I have tried:
<pre>Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim Number As String = TextBoxOprtr1.Text
If Number.ToString.Length = 4 Then
Dim FirstDigit As String = Mid(Number, 1, 1)
Dim RemainingDigits As String = Mid(Number, 2, 3)
TextBoxOprtr2.Text = FirstDigit & "," & RemainingDigits
End If
If Number.ToString.Length = 5 Then
Dim FirstDigits As String = Mid(Number, 1, 2)
Dim RemainingDigits As String = Mid(Number, 3, 3)
TextBoxOprtr2.Text = FirstDigits & "," & RemainingDigits
End If
If Number.ToString.Length = 6 Then
Dim FirstDigits As String = Mid(Number, 1, 3)
Dim RemainingDigits As String = Mid(Number, 4, 3)
TextBoxOprtr2.Text = FirstDigits & "," & RemainingDigits
End If
If Number.ToString.Length = 7 Then
Dim FirstDigits As String = Mid(Number, 1, 1)
Dim NextDigits As String = Mid(Number, 2, 3)
Dim RemainingDigits As String = Mid(Number, 5, 3)
TextBoxOprtr2.Text = FirstDigits & "," & NextDigits & "," & RemainingDigits
End If