ASP 人民幣小寫轉換為大寫

2021-04-13 23:29:01 字數 810 閱讀 7065

人民幣小寫轉換為大寫

<%

'****人民幣大小寫轉換格式****

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

%>

人民幣小寫轉換為大寫

本程式的作用是將人民幣的小寫形式轉換為大寫,例如 呼叫upper 18.5 將會返回字串 壹拾捌圓伍角 package com.zzb.test0 import junit.framework.assert import org.junit.test 測試人民幣小寫轉大寫 author zhengz...

人民幣小寫金額轉換為大寫函式

程式 function money thenumber dim money,i,string1,string2,length,checkp 定義變數 dim one onestr 定義陣列 string1 零壹貳叄肆伍陸柒捌玖 string2 萬仟佰拾億仟佰拾萬仟佰拾元角分釐毫 checkp ins...

人民幣小寫金額轉換為大寫函式

程式 functionmoney thenumber dimmoney,i,string1,string2,length,checkp 定義變數 dimone onestr 定義陣列 string1 零壹貳叄肆伍陸柒捌玖 string2 萬仟佰拾億仟佰拾萬仟佰拾元角分釐毫 checkp instr ...