|
先自定义一个函数BIGNUM,代码如下: Public Function BigNum(小写数字 As Currency)
Application.Volatile
If 小写数字 = 0 Then
BigNum = "零元整"
Else
Const cNum = "零壹贰叁肆伍陆柒捌玖-万仟佰拾亿仟佰拾万仟佰拾元角分"
Const cCha = "零仟零佰零拾零零零零零亿零万零元亿万零角零分零整-零零零零零亿万元亿零整整"
BigNum = ""
sNum = Trim(Str(Int(Round(小写数字, 2) * 100)))
For i = 1 To Len(sNum) '逐位转换
BigNum = BigNum + Mid(cNum, (Mid(sNum, i, 1)) + 1, 1) + Mid(cNum, 26 - Len(sNum) + i, 1)
Next i
For i = 0 To 11 '去掉多余的零
BigNum = Replace(BigNum, Mid(cCha, i * 2 + 1, 2), Mid(cCha, i + 26, 1))
Next i
End If
End Function |
|