VB加零函数

前端之家收集整理的这篇文章主要介绍了VB加零函数前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Public Function AddZero(strTmp As String) As String '添加0
    Dim intCD,intCDC As Integer
    intCD = Len(strTmp)
    intCDC = 10 - intCD
    If intCDC > 0 Then
        Dim strZCD As String
        strZCD = String(intCDC,"0")
    ElseIf intCDC = 0 Then
        AddZero = strTmp
        Exit Function
    Else
        MsgBox "长度已超出10000000000位,请与系统管理员联系",vbCritical,"错误"
        AddZero = ""
        Exit Function
    End If
    AddZero = strZCD + strTmp
End Function

猜你在找的VB相关文章