[ASP code]
Response.write (CBMoney (12345.67))
Function CBMoney (NUM) IF INSTR (Num, ")> 0 Then Arrnum = Split (Num,". "Znum = arrnum (0) xnum = arrnum (1) Hasdot = true else znum = Num End ifss bmoney = "Zero,,, 叁,,,, 柒, 捌, 玖, 玖, 拾, a, a,", ",",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 元, Znum) zmunit = Right (Replace (Zmunit, ",", ""), ZLENNUM) DIM Newzunit for i = 1 to len (zmunit) newzunit = newzunit & mid (zmunit, i, 1) & "," next zmunit = left Newzunit, neWZUNIT) -1) Arrzmunit = split (zmunit, ",") xmunit = "angle, division" arrxmunit = split (xmunit, ",") DIM strbmoney for i = 1 to zlennum nchar = cint (MID Znum, I, 1)) Strbmoney = StrBmoney & Arrbmoney (nchar) & "" & arrzmunit (i-1) & " b>" Next if Hasdot Then Xlennum = LEN (XNUM) for i = 1 to Xlennum nchar = CINT (MID (XNUM, I, 1)) StrBmoney = Strbmoney & Arrbmoney (Nchar) & "" & Arrxmunit (i-1) & " b>" Next End End IF CBMONEY = StrbmoneyEnd Function
[ASP.NET (C #)]
Description: Cmoney.aspx page omitted, there is three web control controls, TextBoxt (ID = txtnum), Button, Label (ID = lblret)
File name: cmoney.aspx.cs (cbmoney is the main function)