¼¼Êõ µã
- ¼¼Êõ
- µã
- V±Ò
- µã
- »ý·Ö
- 207
|
ÉÏ´«Ò»¸öÊý×Ö½ð¶îת»»³ÉÖÐÎÄ´óд½ð¶îµÄº¯Êý
Public Function MoneyConv(Money As Currency) As String
On Error GoTo Doerr
Dim CN(9) As String
Dim CU(15) As String
Dim Temp As String, strNum As String
Dim CM As String
Dim tFirst As String, tEnd As String
Dim i As Long, j As Long, k As Long
CN(0) = "Áã"
CN(1) = "Ò¼"
CN(2) = "·¡"
CN(3) = "Èþ"
CN(4) = "ËÁ"
CN(5) = "Îé"
CN(6) = "½"
CN(7) = "Æâ"
CN(8) = "°Æ"
CN(9) = "¾Á"
' CU(0) = "·Ö"
' CU(1) = "½Ç"
CU(0) = "Ô²"
CU(1) = "Ê®"
CU(2) = "°Û"
CU(3) = "Ǫ"
CU(4) = "Íò"
CU(5) = "Ê®"
CU(6) = "°Û"
CU(7) = "Ǫ"
CU(8) = "ÒÚ"
CU(9) = "Ê®"
CU(10) = "°Û"
CU(11) = "Ǫ"
If Money = 0 Then
CM = "ÁãÔ²Õû"
GoTo Complete
End If
strNum = Trim(str(FormatCurrency(Money, 2, vbTrue, vbFalse, vbFalse)))
If Left(strNum, 1) = "-" Then
tFirst = "¸º"
strNum = Right(strNum, Len(strNum) - 1)
Else
tFirst = ""
End If
i = InStrRev(strNum, ".")
If i <> 0 Then
Temp = Right(strNum, i)
If Len(strNum) - i = 1 Then Temp = Temp + "0"
CM = CN(CInt(Left(Right(Temp, 2), 1))) + "½Ç" + CN(CInt(Right(Temp, 1))) + "·Ö"
tEnd = ""
strNum = Left(strNum, i - 1)
Else
tEnd = "Õû"
End If
i = 0
For j = Len(strNum) To 1 Step -1
k = CInt(Right(Left(strNum, j), 1))
If k = 0 Then
If i <> 0 And i <> 4 And i <> 8 Then
CM = CN(k) + CM
Else
CM = CN(k) + CU(i) + CM
End If
Else
CM = CN(k) + CU(i) + CM
End If
' CM = CN(k) + CU(i) + CM
i = i + 1
Next j
CM = tFirst + CM + tEnd
CM = Replace(CM, "ÁãÁã", "Áã")
CM = Replace(CM, "ÁãÁã", "Áã")
CM = Replace(CM, "ÒÚÁãÍòÁãÔ²", "ÒÚÔ²")
CM = Replace(CM, "ÒÚÁãÍò", "ÒÚÁã")
CM = Replace(CM, "ÍòÁãÔ²", "ÍòÔ²")
CM = Replace(CM, "ÁãÒÚ", "ÒÚ")
CM = Replace(CM, "ÁãÍò", "Íò")
CM = Replace(CM, "ÁãÔ²", "Ô²")
CM = Replace(CM, "ÁãÁã", "Áã")
CM = Replace(CM, "ÁãÁã", "Áã") 'Öظ´Ìæ»»Ò»´Î
Complete:
Gerr = 0 '²Ù×÷³É¹¦,ÎÞ´íÎó·¢Éú
MoneyConv = CM
Exit Function
Doerr:
Gerr = -1 'δ֪´íÎó
Errexit:
MoneyConv = ""
End Function[em07][em07] |
|