vb编程:实现钱的大小写转换(整数)

来源:百度知道 编辑:UC知道 时间:2024/06/09 13:59:53

Private Sub Command1_Click()
Text2.Text = Num2Chi(Val(Text1.Text))
End Sub
Private Function Num2Chi(txtJE As Double) As String
Dim i, K As Integer
Dim NC, nd, ka, chrNum, strZheng As String
Dim c1, c2, c3 As String
Dim K1 As Integer
Dim Zheng As String
Dim Xiao As String
NC = Trim(Format(txtJE, "##0.00"))
c1 = "仟佰拾万仟佰拾亿仟佰拾万仟佰拾元"
c2 = "角分"
c3 = "玖捌柒陆伍肆叁贰壹"
If NC = 0 Then
Num2Chi = "零元整"
Exit Function
End If
Num2Chi = ""
Zheng = Mid(NC, 1, (Len(NC) - 3))
Xiao = Mid(NC, (Len(Zheng) + 2))
If Val(Xiao) <> 0 Then
For i = Len(Xiao) To 1 Step -1