代码:
Public Function ConvertCH(num As String) As String
Dim chnum As String, chsig As String
Dim s, res As String
Dim i As Integer
chnum = ("零一二三四五六七八九")
chsig = "分角元拾佰仟万拾佰仟亿"
res = ""
num = num + IIf(InStr(num, ".") = 0, ".", "")
s = Left(num, InStr(num, ".") - 1) + Mid(num + " ", InStr(num, ".") + 1, 2)
For i = 1 To Len(s)
res = res + Mid(chnum, (Val(Mid(s, i, 1))) + 1, 1) + Mid(chsig, Len(s) - i + 1, 1)
Next i
ConvertCH = res
End Function 作者: HG 时间: 2002-8-20 19:26
陳理先生,好作品,代碼發精練。
可以看一看一樣同類作品哪?
ftp:access-cn@office-cn.net/hg.mdb passwd:access-cn
作品有一個數據換英文的轉換函數,但現在的問題是只能處理長度為3位以上和3位的倍數的數字,因我一知為此問題所困撓,可以幫忙debug嗎?多多謝。作者: zyz 时间: 2002-8-20 19:36
还是 yuab 版主的好!