根據數字的讀法源碼天空
參數一為數字
參數二為是不是反回人民幣大寫
參數三為是不是直接讀數字
參數四為設置小數點後面的位數
使用方法是
t=GetChinaNum(
t=GetChinaNum(
t=GetChinaNum(
下面是程序代碼
Function GetChinaNum(otherNum As Double
On Error Resume Next
num = Trim(Str(Int(otherNum)))
If isRMB Then
numwei =
numshu =
Else
numwei =
numshu =
End If
If otherNum <
num = Right(num
GetChinaNum = Left(numwei
End If
For i =
bstr = Mid(num
If numOption Then
GetChinaNum = GetChinaNum + Mid(numshu
Else
GetChinaNum = GetChinaNum + Mid(numshu
If bstr =
If Mid(numwei
Do While Right(GetChinaNum
GetChinaNum = Left(GetChinaNum
Loop
GetChinaNum = GetChinaNum + Mid(numwei
End If
Else
GetChinaNum = GetChinaNum + Mid(numwei
End If
GetChinaNum = Replace(GetChinaNum
End If
Next i
If numOption = False Then
Do While Right(GetChinaNum
GetChinaNum = Left(GetChinaNum
Loop
End If
If isRMB Then
numrmb =
GetChinaNum = GetChinaNum + Mid(numrmb
If Val(num) <> otherNum Then
num = Trim(Str(Round(otherNum
For i =
bstr = Mid(num
GetChinaNum = GetChinaNum + Mid(numshu
Next i
Else
GetChinaNum = GetChinaNum +
End If
Else
If Val(num) <> otherNum Then
If dotNum =
num = Trim(CStr(Round(otherNum
If GetChinaNum =
GetChinaNum = GetChinaNum +
For i =
bstr = Mid(num
GetChinaNum = GetChinaNum + Mid(numshu
Next i
End If
End If
End Function
From:http://tw.wingwit.com/Article/program/net/201311/12736.html