永发信息网

access中如何将*替换为x(大写x)

答案:1  悬赏:20  手机版
解决时间 2021-01-15 00:45
  • 提问者网友:雾里闻花香
  • 2021-01-14 02:08
access中如何将*替换为x(大写x)
最佳答案
  • 五星知识达人网友:猎心人
  • 2021-01-14 02:22
给你2个连接 关于此主题请参考: 如何将人民币小写金额转为大写?大小写转换(一)《VBA》 http://access911.net/index.asp?u1=a&u2=71FAB21E 关于此主题请参考: 如何将人民币小写金额转为大写?大小写转换(二)《VBA》 http://access911.net/index.asp?u1=a&u2=73FAB21E 给你2个函数 Function shit(shit1 As Variant) As String '此函数将阿拉伯数字转换为大写金额数,其中调用了 yahoo函数 On Error GoTo err_handle Dim rem_thousand As Single '千位以后 Dim dec_num '小数点以后 Dim shit2 Dim shit3 As String Dim I As Integer Dim declen As Integer shit = "" 'shit2 = Trim(Str(Abs(shit1))) If IsNull(shit1) Then shit1 = 0 End If shit2 = Trim(Format(Abs(shit1), "0.00")) declen = Len(Format(Str(Abs(shit2)), "0.00")) - 3 '3是小数点及以后2位 If declen <= 4 Then shit = shit + yahoo(Mid(shit2, 1, declen)) Else shit3 = Trim(Str(Val(Mid(shit2, declen - 3, 4)))) ' MsgBox Str(Len(shit3)) + "," + shit3 If Mid(shit2, declen - 3, 1) = "0" Then If Val(shit3) = 0 Then shit = shit + yahoo(Mid(shit2, 1, declen - 4)) + "万" + yahoo(shit3) Else shit = shit + yahoo(Mid(shit2, 1, declen - 4)) + "万零" + yahoo(shit3) End If Else shit = shit + yahoo(Mid(shit2, 1, declen - 4)) + "万" + yahoo(shit3) End If End If If Abs(shit1) >= 1 Then shit = shit + "元" End If '================== '小数点以后 'dec_num = (shit1 - Fix(shit1)) * 100 dec_num = Val(Right(Format(Str(Abs(shit2)), "0.00"), 2)) ' MsgBox Right(Trim(Str(shit1)), 2) If (dec_num Mod 10) = 0 Then If (dec_num \ 10) <> 0 Then shit = shit + chn(dec_num \ 10) + "角" End If Else If (dec_num \ 10) <> 0 Then shit = shit + chn(dec_num \ 10) + "角" + chn(dec_num Mod 10) + "分" Else shit = shit + chn(dec_num \ 10) + chn(dec_num Mod 10) + "分" End If End If '=================== shit = shit + "整" If shit1 = 0 Then shit = "零元整" End If err_exit: Exit Function err_handle: MsgBox "发生错误!请找原因" GoTo err_exit End Function Function chn(shit2 As Integer) As String Select Case shit2 Case 1 chn = "壹" Case 2 chn = "贰" Case 3 chn = "叁" Case 4 chn = "肆" Case 5 chn = "伍" Case 6 chn = "陆" Case 7 chn = "柒" Case 8 chn = "捌" Case 9 chn = "玖" Case 0 chn = "零" End Select End Function Function yahoo(yaa As String) As String '此函数被shit()调用 Dim shit_len Dim num(5) As Integer shit_len = Len(yaa) For I = 1 To shit_len num(I) = Mid(yaa, shit_len - I + 1, 1) Next I yahoo = "" Select Case shit_len Case 1 '元 If num(1) <> 0 Then yahoo = yahoo + chn(num(1)) End If 'MsgBox yahoo Case 2 '十 If num(1) <> 0 Then yahoo = yahoo + chn(num(2)) + "拾" + chn(num(1)) Else yahoo = yahoo + chn(num(2)) + "拾" End If Case 3 '百 If num(1) = 0 Then If num(2) = 0 Then yahoo = yahoo + chn(num(3)) + "佰" Else yahoo = yahoo + chn(num(3)) + "佰" + chn(num(2)) + "拾" End If Else If num(2) = 0 Then yahoo = yahoo + chn(num(3)) + "佰零" + chn(num(1)) Else yahoo = yahoo + chn(num(3)) + "佰" + chn(num(2)) + "拾" + chn(num(1)) End If End If Case 4 '千 If num(1) = 0 Then If num(2) = 0 Then If num(3) = 0 Then yahoo = yahoo + chn(num(4)) + "仟" Else yahoo = yahoo + chn(num(4)) + "仟" + chn(num(3)) + "佰" End If Else If num(3) = 0 Then yahoo = yahoo + chn(num(4)) + "仟零" + chn(num(2)) + "拾" Else yahoo = yahoo + chn(num(4)) + "仟" + chn(num(3)) + "佰" + chn(num(2)) + "拾" End If End If Else If num(2) = 0 Then If num(3) = 0 Then yahoo = yahoo + chn(num(4)) + "仟零" + chn(num(1)) Else yahoo = yahoo + chn(num(4)) + "仟" + chn(num(3)) + "佰零" + chn(num(1)) End If Else If num(3) = 0 Then yahoo = yahoo + chn(num(4)) + "仟零" + chn(num(2)) + "拾" + chn(num(1)) Else yahoo = yahoo + chn(num(4)) + "仟" + chn(num(3)) + "佰" + chn(num(2)) + "拾" + chn(num(1)) End If End If End If End Select End Function
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯