VB加零函数

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

猜你在找的VB相关文章