'''' 传入 num 传回干支, 0=甲子 Public Function GanZhi(num As Long) As String Dim tempStr As String Dim i As Long i = (num - 1864) Mod 60 ''''计算干支 tempStr = Gan(i Mod 10) & Zhi(i Mod 12) GanZhi = tempStr End Function
''''计算年的属相字串 Public Function YearAttribute(y As Long) As String YearAttribute = Animals((y - 1900) Mod 12) End Function
''''将数字汉化 Public Function UpNumber(Dxs As String) As String
''''检测为空时 If Trim(Dxs) = "" Then UpNumber = "" Exit Function End If
Dim Sw As Integer, SzUp As Integer, tempStr As String, DXStr As String Sw = Len(Trim(Dxs))
Dim i As Integer For i = 1 To Sw tempStr = Right(Trim(Dxs), i) tempStr = Left(tempStr, 1) tempStr = Converts(tempStr) Select Case i Case 1 If tempStr = "零" Then tempStr = "" Else tempStr = tempStr + "" End If Case 2 If tempStr = "零" Then tempStr = "零" Else tempStr = tempStr + "十" End If Case 3 If tempStr = "零" Then tempStr = "零" Else tempStr = tempStr + "百" End If Case 4 If tempStr = "零" Then tempStr = "零" Else tempStr = tempStr + "千" End If Case 5 If tempStr = "零" Then tempStr = "万" Else tempStr = tempStr + "万" End If Case 6 If tempStr = "零" Then tempStr = "零" Else tempStr = tempStr + "十" End If Case 7 If tempStr = "零" Then tempStr = "零" Else tempStr = tempStr + "百" End If Case 8 If tempStr = "零" Then tempStr = "零" Else tempStr = tempStr + "千" End If Case 9 If tempStr = "零" Then tempStr = "亿" Else tempStr = tempStr + "亿" End If End Select Dim TempA As String TempA = Left(Trim(DXStr), 1) If tempStr = "零" Then Select Case TempA Case "零" DXStr = DXStr Case "万" DXStr = DXStr Case "亿" DXStr = DXStr Case Else DXStr = tempStr + DXStr End Select Else DXStr = tempStr + DXStr End If Next
UpNumber = DXStr End Function Private Function Converts(NumStr As String) As String Select Case val(NumStr) Case 0 Converts = "零" Case 1 Converts = "一" Case 2 Converts = "二" Case 3 Converts = "三" Case 4 Converts = "四" Case 5 Converts = "五" Case 6 Converts = "六" Case 7 Converts = "七" Case 8 Converts = "八" Case 9 Converts = "九" End Select End Function ''''中文日期 Public Function CDayStr(d As Long) As String Dim s As String Select Case d Case 0 s = "" Case 10 s = "初十" Case 20 s = "二十" &nbs