vb代码,判断整数和小数点数据比较,比如:123456和1234.56匹配,怎么样判断?
1个回答
展开全部
去掉小数点 转换成字符串 ,再判断字符串相等就可以 。去除小数点函数如下:
Function WipeDotToStr(ByVal a As Double) As String
Dim i, j As Integer
Dim StrT As String, T As String
StrT = ""
For i = 1 To Len(Str(a))
T = Mid(a, i, 1)
If T <> "." Then StrT = StrT + T
Next
Return StrT
End Function
Function WipeDotToStr(ByVal a As Double) As String
Dim i, j As Integer
Dim StrT As String, T As String
StrT = ""
For i = 1 To Len(Str(a))
T = Mid(a, i, 1)
If T <> "." Then StrT = StrT + T
Next
Return StrT
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询