金额转换成汉字,输出
Ge 2003-09-03 03:52:21 Public Function Chbig(sdata As String) As String
Dim leng As Integer
Dim stmp As String
Dim bdata As String
Dim s As String
Dim p, b As String
Dim s2 As String
Dim f As Boolean
Dim n, n1, c As Integer
Select Case Len(sdata)
Case 5
s = "万"
Case 4
s = "仟"
Case 3
s = "佰"
Case 2
s = "拾"
Case 1
s = ""
End Select
For n = 1 To Len(sdata)
For n1 = n To Len(sdata)
s2 = Mid(sdata, n1, 1)
If s2 <> "0" Then
GoTo nex
End If
Next n1
GoTo ex
nex:
stmp = Mid(sdata, n, 1)
Select Case stmp
Case "1"
bdata = "壹" & s
Case "2"
bdata = "贰" & s
Case "3"
bdata = "叁" & s
Case "4"
bdata = "肆" & s
Case "5"
bdata = "伍" & s
Case "6"
bdata = "陆" & s
Case "7"
bdata = "柒" & s
Case "8"
bdata = "捌" & s
Case "9"
bdata = "玖" & s
End Select
Select Case s
Case "万"
s = "仟"
Case "仟"
s = "佰"
Case "佰"
s = "拾"
Case "拾"
s = ""
End Select
If n > 1 And stmp = "0" Then
If p = "零" Then
bdata = ""
Else
p = "零"
bdata = "零"
End If
End If
s1 = s1 & bdata
next1:
Next n
ex:
Chbig = s1 & "元整"
End Function