以下是引用海狸先生在2005-12-24 15:09:00的发言:
Public Function GetBit(BitNo As Integer, value As Currency) As String
If BitNo <= -Fix(-Log(value) / Log(10#)) Then
GetBit = Int(CCur(value / 10 ^ BitNo)) Mod 10
Else
If BitNo = -Fix(-Log(value) / Log(10#)) + 1 Then
GetBit = "¥"
End If
End If
End Function
Public Function GetBit(BitNo As Integer, value As Currency) As String
Dim intNo As Integer
intNo = -Log(value) / Log(10#)
If BitNo <= - Fix(intNo) Then
GetBit = Int(CCur(value / 10 ^ BitNo)) Mod 10
Else
If BitNo = - Fix(intNo) + 1 Then
GetBit = "¥"
End If
End If
End Function
Public Function CHN(BigNo As String, IntNo As Integer)
Const cnum = "零壹贰叁肆伍陆柒捌玖"
CHN = ""
sNum = Trim(BigNo * 100)
For I = 1 To Len(sNum)
CHN = CHN + Mid(cnum, Mid(sNum, I, 1) + 1, 1)
Next I
CHN = StrReverse(CHN) & "¥"
For I = 1 To Len(CHN)
If I = IntNo Then
CHN = Mid(CHN, I, 1)
End If
Next I
If IntNo >= I Then CHN = ""
End Function