A function just written, but only the value below "100 million" is valid. If the value of the value exceeds the value of the last type, the conversion will be wrong !!!! Function directly use the changeMoney (value) !! After the conversion The amount below is the first to write: 0.% response.write (ChangeMoney (235)) Function ChangeMoney (Smoney) on Error Resume Nextdim stodim IINT, Imod 'gets integer smoney = Smoney / 1IF ERR .Number <> 0 Then Response.write "value too big !! Can't convert !!" Response.Endend IFIINT = LEN (Smoney) if Iint> 5 Then 'More than 10,000 Imod = IINT-4 STO = Changeto (Smone, Imod, 1) Imod = 4 sto = sto & "10,000" sto = sto & channelo (smoney, imod, 0) & "Yuan" Else Sto = Changeto (Smone, IINT, 0) & "Yuan" end ifchangemoney = stoend functionFunction Changeto (Smoney " , INUM, ITO) DIM STR Do While Inum> 0 str = Str & GetMoney (SMONEY, INUM, ITO) Inum = inum-1 loop Changeto = Strend FunctionFunction GETMONEY (SMONEY, Inum, ITO) DIM SMEN, SSTR, ILEN ILEN = LEN SMONEY - (Inum ITO * 5) 1 ITO SMEN = "Zero Zi 肆 柒捌 柒捌" SELECT CASE INUM CASE 5 if ITO = 1 THEN SSTR = "100 million" Else SSTR = "10,000" End IF Case 4 SSTR = "Thousand" CAS E 3 sstr = "100" case 2 sstr = "10" Case Else SSTR = "" End Select getMoney = MID (SMEN, CINT (MID (SMONEY, ILEN, 1)) 1, 1) & Sstrend Function%>
Last modified, a continuous 0 hidden role:
<% Response.write (ChangeMoney (2032400))
Function ChangeMoney (SMONEY) ON Error Resume Nextdim stodim IINT, IMOD 'gets integer smoney = smoney / 1if err.Number <> 0 Then response.write "value is too big !! Cannot be converted !!" Response.Endend IFIF LEFT (SMONEY, 1) = "0" 0 "Then Response.write" Enter the value of the error! Head can't be 0! "Response.Endend IFIINT = LEN (Smoney) if Iint> 5 TEN 'More than 10,000 Imod = IINT-4 STO = Changeto (SMoney, Imod, 1) Imod = 4 Sto = Sto & "Wan" sto = sto & channelo (smoney, imoD, 0) & "Yuan" Else Sto = Changeto (Smone, IINT, 0) & "Yuan" end ifchangemoney = stoend functionFunction Changeto (SMONEY, INUM, ITO) DIM STR Do While Inum> 0 str = Str & GetMoney (Smone, Inum, ITO) Inum = Inum-1 Loop ChangeTo = Strend Function
Function GETMONEY (SMONEY, INUM, ITO) DIM SMEN, SSTR, ILEN, SNUM, SVAL ILEN = LEN (SMONEY) - (Inum ITO * 5) 1 ITO SMEN = "Zero Zibo Lu Lu Yu "Sval =" 10 million "SSTR = MID (Sval, Inum, 1) if inum = 5 and ITO = 1 Then 'billion sstr =" 100 million "end if snum = MID (SMONEY, ILEN, 1) IF SNUM < > "0" Then getMoney = MID (Smen, CINT (SNUM) 1, 1) & Trim (SSTR) Else getMoney = "" "" End IFend Function% "