某某茶叶有限公司欢迎您!
金沙棋牌在线 > 操作系统 > 中文数字转字符数字

中文数字转字符数字

时间:2020-01-17 14:29
CLEAR 
cStr="第一百零七章 好事多磨"
=ALINES(Astr,cStr,"第","章")
nLen=0
cLstr=""
cRstr=""
cStr1=astr[2]
* 左取两个字符
IF LEFT(cStr1,2)="十" AND LEN(cStr1)>2
    cLstr="1"
    cStr1=cLstr+SUBSTR(astr[2],3)
ENDIF 
* 右取两个字符
DO CASE
    CASE RIGHT(cStr1,2)="十" AND LEN(cStr1)=2
        cRstr="10"
        nLen=2
    CASE RIGHT(cStr1,2)="十" AND LEN(cStr1)>2
        cRstr="0"
        nLen=2
    CASE RIGHT(cStr1,2)="百" AND LEN(cStr1)>2
        cRstr="00"
        nLen=2
ENDCASE
cStr1=LEFT(cStr1,LEN(cStr1)-nLen)+cRstr
cStr1=CHRTRANC(CHRTRANC(cStr1,"百十",""),"零一二三四五六七八九","0123456789")
?"第 "+PADL(cStr1,4,"0")+" 章"+Astr[3]