[ASP]人民幣小寫轉換爲大寫

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>人民幣小寫轉換爲大寫</title>
</head>

<body>
人民幣小寫轉換爲大寫

<%
'****人民幣大小寫轉換格式****
dim str(9)
str(0)="零"
str(1)="壹"
str(2)="貳"
str(3)="叄"
str(4)="肆"
str(5)="伍"
str(6)="陸"
str(7)="柒"
str(8)="捌"
str(9)="玖"
aa=Request.form("source")
hh=formatnumber(aa,2,-1)
aa=replace(hh,".","")
aa=replace(aa,",","")
for i=1 to len(aa)
s=mid(aa,i,1)
mynum=str(s)
select case(len(aa)+1-i)
case 1: k= mynum&"分"
case 2: k= mynum&"角"
case 3: k= mynum&"元"
case 4: k= mynum&"拾"
case 5: k= mynum&"佰"
case 6: k= mynum&"仟"
case 7: k= mynum&"萬"
case 8: k= mynum&"拾"
case 9: k= mynum&"佰"
case 10: k= mynum&"仟"
end select
m=m&k
next
%>


<html>
<head>
<title>數字轉換</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<!--
Elseif(s=".") then
n=m
i=i+2
for j=i to len(aa)
s=mid(aa,i,1)
mynum=str(s)
select case(len(aa)+1-i)
case 1: p= mynum&"分"
case 2: p= mynum&"角"
end select
m=m&p
next
-->

<body bgcolor="#FFFFFF">
<form method="post" name="forma">
<input type="text" name="source" value="<%=hh%>">
=
<input type="text" name="result" value="<%=m%>" size="40">

<input type="submit" name="Submit" value="提交 " >
</form>
</body>
</html>


</body>

</html>

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章