Function CNMoney(money As Double) As String Dim str_Money=money.ToString() Dim str_China As [String]() = {"分", "角", "元", "拾", "佰", "仟", _ "万", "拾", "佰", "仟", "亿", "拾", _ "佰", "仟", "兆", "拾", "佰", "仟"} Dim str_Number As [String]() = {"零", "壹", "贰", "叁", "肆", "伍", _ "陆", "柒", "捌", "玖"} Dim M As [String] = "" Dim isPoint As Boolean = False If str_Money.IndexOf(".") <> -1 Then str_Money = str_Money.Remove(str_Money.IndexOf("."), 1) isPoint = True End If For i As Integer = str_Money.Length To 1 Step -1 Dim MyData As Integer = Convert.ToInt16(str_Money(str_Money.Length - i).ToString()) M += str_Number(MyData) If isPoint = True Then M += str_China(i - 1) Else M += str_China(i + 1) End If Next Return M End Function
Dim str_Money=money.ToString()
Dim str_China As [String]() = {"分", "角", "元", "拾", "佰", "仟", _
"万", "拾", "佰", "仟", "亿", "拾", _
"佰", "仟", "兆", "拾", "佰", "仟"}
Dim str_Number As [String]() = {"零", "壹", "贰", "叁", "肆", "伍", _
"陆", "柒", "捌", "玖"}
Dim M As [String] = ""
Dim isPoint As Boolean = False
If str_Money.IndexOf(".") <> -1 Then
str_Money = str_Money.Remove(str_Money.IndexOf("."), 1)
isPoint = True
End If
For i As Integer = str_Money.Length To 1 Step -1
Dim MyData As Integer = Convert.ToInt16(str_Money(str_Money.Length - i).ToString())
M += str_Number(MyData)
If isPoint = True Then
M += str_China(i - 1)
Else
M += str_China(i + 1)
End If
Next
Return M
End Function