In following code if I encounter some incorrect result while I applied following input to the code.
Code is as follow.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox(TextBox1.Text & " = Val(" & Val(TextBox1.Text) & ") = Math.Round(" & Math.Round(Val(TextBox1.Text)) & ")")
End Sub
Input applied => Output Received
3.5 => 4
5.5 => 6
4.5 => 4
Math.Round function returns correct result in first two inputs, but third result is incorrect.
Please help me to sort it out.