-- 如何判断某值是否是整数?
Dim zgf As Integer = DataTables("成绩库").Compute("Max(总分)", "[部别] = \'"& bb &"\' And [类别] = \'" & tjlb & "\'And [年级] = \'"& tjnj &"\'")如何判断“zgf”是否是整数?如果是整数就直接取名次,如果是存在0.5分就加0.5分取名次再将名次加1.
if zgf “是整数” Then
Dim gw As Integer = CInt(zgf) Mod 10
Dim fsd As Integer = CInt(zgf) - gw
Dim fdr As DataRow = dt_source.Find("分数段 = \'" & fsd & "\'And 部别 = \'" & bb & "\' And 年级 = \'" & tjnj & "\'And 类别 = \'" & tjlb & "\'")
If fdr IsNot Nothing Then
dr(bb & tjnj) = fdr("加" & gw & "分")
End If
Else
Dim gw As Integer = CInt((zgf) + 1) Mod 10
Dim fsd As Integer = CInt((zgf) + 1) - gw
Dim fdr As DataRow = dt_source.Find("分数段 = \'" & fsd & "\'And 部别 = \'" & bb & "\' And 年级 = \'" & tjnj & "\'And 类别 = \'" & tjlb & "\'")
If fdr IsNot Nothing Then
dr(bb & tjnj) = fdr("加" & gw & "分") + 1
End If
End If
怎样修改红色字体代码?请指教。谢谢!