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 !! Cannot be converted !!"? Response.endendness ifiint = len (smoney) if Iint> 5 Then?? More than 10,000? Ivod = IINT-4 ???? = 4?? IMOD = 4?? STO = STO & "10,000"? STO = STO & CHANGETO (SMONEY, IMOD, 0) & "Yuan" Else?? sto = channeleto (Smoney, SMONEY , IINT, 0) & "Yuan" end ifchangemoney = STOEND FUNCTIONFUNCTION CHANGETO (SMONEY, INUM, ITO)? DIM STR? Do While Inum> 0????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? 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 Zhai 叁 肆 柒捌 柒捌"?? SELECT CASE INUM?????????????????? ?? sStr = "one hundred million"????????? Else?????????? sStr = "Wan"????????? End If?? ?? ?? Case 4??? Sstr = "千" ?????? Cas E3???????????????????????????????????? ?????????? endMoney = MID (Smen, CINT (MID (Smone, 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 !! Can't convert !!"? Response.endend Ifif Left (SMONEY, 1) = "0" Then ?? Response.write "Enter the value of the error! Head can't be 0!" ?? response.endend ifiint = len (smoney) if Iint> 5 Then ??? 'More than 10,000 ?? imod = IINT-4 ?? STO = Changeto (SMONEY, IMOD, 1) ?? IMOD = 4 ?? STO = STO & "10,000" ?? STO = Sto & Changeto (Smone, IMOD, 0) & "Yuan" ELSE ?? STO = CHANGETO (SMONEY, IINT, 0) & "Yuan" end ifchangemoney = stoend functionfunction channelo (SMONEY, INUM, ITO) ?? DIM STR ?? do while inum> 0 ????? str = str & getmoney SMONEY, 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 壹 叁伍 Lu 柒捌 "?? sval =" 10 million "?? sstr = MID (Sval, Inum, 1) ?? if inum = 5 and ito = 1 THEN ?? ????? 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%>
From:
Fish of paradise and hell