Please refer below code
C#
string val = "1234.22";
if (val.Split('.')[1].Length > 2)
{
val = val.Split('.')[0] + '.' + val.Split('.')[1].Substring(0, 1);
}
decimal d = Convert.ToDecimal(val);
string result = d.ToString("0.00");
VB
Dim val As String = "1234.22"
If val.Split("."C)(1).Length > 2 Then
val = val.Split("."C)(0) + "."C + val.Split("."C)(1).Substring(0, 1)
End If
Dim d As Decimal = Convert.ToDecimal(val)
Dim result As String = d.ToString("0.00")
I hope this will help you out.