Function Daxie(jexx)
jezs = (CStr(Round(jexx, 2) * 100)) '金额最终数含小数
ws = "拾万仟佰拾元角分"
dx = "零壹贰叁肆伍陆柒捌玖"
Dim i, j As Integer
Dim jedx As String
i = 1
j = Len(Trim(Round(jexx, 2) * 100)) '金额的位数
If j > 8 Then
ts = MsgBox("金额超出范围,不能打印。", , "信息提示")
Exit Function
End If
jedx = "" '大写金额
Do While i <= j
If CInt(Mid(jezs, j - i + 1, 1)) = 0 Then
If i = 1 Then
jedx = "整"
Else
'If CInt(Mid(jezs, j - i, 1)) <> 0 Then
If Left(jedx, 1) <> "零" And Left(jedx, 1) <> "整" And Left(jedx, 1) <> "元" And Left(jedx, 1) <> "万" Then
jedx = "零" & jedx
End If
If i = 3 Then
jedx = "元" & jedx
End If
If i = 7 Then
jedx = "万" & jedx
End If
End If
Else
jedx = Mid(dx, CInt(Mid(jezs, j - i + 1, 1)) + 1, 1) & Mid(ws, 8 - i + 1, 1) & jedx
End If
'Mid(dx, CInt(Mid(jezs, j - i + 1, 1)) + 1, 1) '取大写
'& Mid(ws, 8 - i + 1, 1) '取单位 & jedx
i = i + 1
Loop
Daxie = jedx '返回大写金额
End Function
jezs = (CStr(Round(jexx, 2) * 100)) '金额最终数含小数
ws = "拾万仟佰拾元角分"
dx = "零壹贰叁肆伍陆柒捌玖"
Dim i, j As Integer
Dim jedx As String
i = 1
j = Len(Trim(Round(jexx, 2) * 100)) '金额的位数
If j > 8 Then
ts = MsgBox("金额超出范围,不能打印。", , "信息提示")
Exit Function
End If
jedx = "" '大写金额
Do While i <= j
If CInt(Mid(jezs, j - i + 1, 1)) = 0 Then
If i = 1 Then
jedx = "整"
Else
'If CInt(Mid(jezs, j - i, 1)) <> 0 Then
If Left(jedx, 1) <> "零" And Left(jedx, 1) <> "整" And Left(jedx, 1) <> "元" And Left(jedx, 1) <> "万" Then
jedx = "零" & jedx
End If
If i = 3 Then
jedx = "元" & jedx
End If
If i = 7 Then
jedx = "万" & jedx
End If
End If
Else
jedx = Mid(dx, CInt(Mid(jezs, j - i + 1, 1)) + 1, 1) & Mid(ws, 8 - i + 1, 1) & jedx
End If
'Mid(dx, CInt(Mid(jezs, j - i + 1, 1)) + 1, 1) '取大写
'& Mid(ws, 8 - i + 1, 1) '取单位 & jedx
i = i + 1
Loop
Daxie = jedx '返回大写金额
End Function