Dim s As String = TextBox1.Text Dim d As Decimal If Decimal.TryParse(s, d) Then d = Decimal.Round(d, 0, MidpointRounding.AwayFromZero) s = d.ToString() Else MsgBox("数値を入力してください") End If
S = Text1.Text S = CStr(Int(CDec(S) + CDec(".5")))