why the two number after the decimal point are always converted to two zeros
Gentleman:
Does anyone knows why the two number after the decimal point are always converted to two zeros with the code below?
Example:
If the real value was 175.53
I only get 175.00
Why is this?
Code:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim MyRegEx As New Regex("=\s+(?<MyPat>\d+)")
Dim s As String = txtDataView.Text
Dim Mc As MatchCollection = MyRegEx.Matches(s)
Dim M As Match
Dim i As Integer
If Mc.Count > 0 Then
i = 0
For Each M In Mc
i += 1
PutInTextBox(Me, "TextBox" & CStr(i), M.Groups("MyPat").Value)
Next
End If
End Sub
Private Sub PutInTextBox(ByVal ContainerCtrl As Control, ByVal TBName As String, ByVal msg As String)
Dim ctl As Control
For Each ctl In ContainerCtrl.Controls
If TypeOf ctl Is TextBox And ctl.Name = TBName Then
ctl.Text = msg
Exit For
Else
PutInTextBox(ctl, TBName, msg)
End If
Next
End Sub
The problem seems to be with the RegEx can you please help me fix it?
Pirate:
The problem seems to be with the RegEx can you please help me fix it?
Thanks
Code:
Dim MyRegEx As New Regex("=\s+(?<MyPat>\d+)")
1 Attachment(s)
Here is the small demo that shows the RegEx.
Pirate:
Here is the small demo that shows the RegEx.
Thanks
Well... Thanks goes to ggprogram who did it !
ggprogram , I know this pattern is sort of encrypted string expression but the question is " How can you really figure it out ?" . Meaning , Are there any rules to structure these patterns ?
Do you know of any program that will help me develop RegEx or Regular Expressions bes
ggprogram or anyone else.
Do you know of any program that will help me develop RegEx or Regular Expressions besides "Expresso" ?
Thanks
Andy