mid=function(str,s=0,e=1){//如果有汉字的话不适用
var l=string.len(str);
var rtn="";
if(l>=s){
rtn=string.left(string.right(str,l-s+1),e);
}
//win.msgbox(type(rtn),rtn,,,);
return(rtn);
}
atob=function(a){
var b={"〇","一","二","三","四","五","六","七","八","九"};
var z={"个","十","百","千","万","十万","百万","千万","亿","十亿","百亿","千亿","万亿","兆"}
var str=tostring(a);
var rtn="";
var s="";
var l=string.len(str);
var lx=0;//记录连续0的个数;
for(i=1;l;1){
var d=tonumber(mid(str,i,1));
if(d<1) {lx++;} else {lx=0;};
if(lx<2){
rtn+=b[d+1];
if(l-i>0 && d!=0){rtn+=z[l-i+1];}
}
}
if(string.len(str)<3){
rtn=string.replace(rtn,"一十","十");
}
if(string.right(rtn,3)=="〇"){rtn=string.left(rtn,string.len(rtn)*3-3)}//win.msgbox(string.len(rtn),rtn,,,);len与left和right测试的长度不一样
return(rtn);
}