这算法也太……
Public Function 大写转换(ByVal NumStr As String) As String
Dim 数 As String, 长 As Integer, i As Integer
数 = ReplaceEx(NumStr, "0", "零 ", "1", "壹 ", "2", "贰 ", "3", "叁 ", "4", "肆 ", "5", "伍 ", "6", "陆 ", "7", "柒 ", "8", "捌 ", "9", "玖 ")
Pos = InStr(NumStr, ".")
If Pos = 0 Then
长 = Len(NumStr)
Else
长 = Pos - 1
End If
For i = 长 To 1 Step - 1
Mid(数, i * 2, 1) = Mid("圆拾佰仟万拾佰仟亿拾佰仟万", 长 - i + 1, 1)
Next
If Pos > 0 Then
NumStr = Replace(数, ".", Empty, Pos * 2 - 1)
数 = Mid(数, 1, (Pos - 1) * 2)
Select Case Len(NumStr)
Case 4
Mid(NumStr, 2, 1) = "角"
Mid(NumStr, 4, 1) = "分"
Case 2
Mid(NumStr, 2, 1) = "角"
End Select
Else
NumStr = Empty
End If
数 = ReplaceEx(数 & NumStr, "零分", Empty, "零角", "零", "零拾", "零", "零佰", "零", "零仟", "零", "零零零", "零", "零零", "零", "零亿", "亿", "零万", "万", "零圆", "圆", "亿万", "亿")
大写转换 = 数
End Function
Public Function ReplaceEx(InputStr As String, ParamArray 参数() As Variant) As String
Dim tmp As Long
ReplaceEx = InputStr
For tmp = 0 To (UBound(参数) - 1) Step 2
ReplaceEx = Replace(ReplaceEx, 参数(tmp), 参数(tmp + 1))
Next
End Function
Private Sub Command1_Click()
Print 大写转换("1442778565.93")
End Sub