日期:2010-02-06 浏览次数:20737 次
'第一个函数,可以强转带小数点的数字格式。
Public Function CheckNumeric(ByVal CHECK_ID)
If CHECK_ID <> "" And IsNumeric(CHECK_ID) Then
If CHECK_ID > 922337203685477 Then CHECK_ID = 0
If CHECK_ID < -922337203685477 Then CHECK_ID = 0
CHECK_ID = CCur(CHECK_ID)
Else
CHECK_ID = 0
End If
CheckNumeric = CHECK_ID
End Function
'第二个函数,可以强转为整数格式。
Public Function ChkNumeric(ByVal CHECK_ID)
If CHECK_ID <> "" And IsNumeric(CHECK_ID) Then
If CHECK_ID < 0 Then CHECK_ID = 0
If CHECK_ID > 2147483647 Then CHECK_ID = 0
CHECK_ID = CLng(CHECK_ID)
Else
CHECK_ID = 0
End If
ChkNumeric = CHECK_ID
End Function