changeBigCh(albsz){//将阿拉伯数字转为中文数字 仅限万以下
console.log(albsz,‘–将阿拉伯数字转为中文数字’)
let zhongStr = ‘’
if(albsz){
let albNum = ‘’
albNum = String(albsz)
console.log(albNum,‘1111111111111111111’)
let wen = [‘十’,‘百’,‘千’,‘万’]
let shu = [
{value:‘零’,
label:0,
},
{value:‘一’,
label:1,
},
{value:‘二’,
label:2,
},
{value:‘三’,
label:3,
},
{value:‘四’,
label:4,
},
{value:‘五’,
label:5,
},
{value:‘六’,
label:6,
},
{value:‘七’,
label:7,
},
{value:‘八’,
label:8,
},
{value:‘九’,
label:9,
},
];
let chaiStrArry = [];
chaiStrArry = albNum.split(‘’);
let strLength = chaiStrArry.length;
if(strLength==1){
console.log(chaiStrArry,strLength,‘222222222222’)
for (let i=0; i<shu.length; i++){
if(shu[i].label == Number(albsz)){
zhongStr = shu[i].value;
break ;
}
}
console.log(zhongStr,‘333333333333333’)
return zhongStr;
}else if(strLength > 1){
let zhongArry = [];
for(let j=strLength-2;j>=0;j–){
for(let k=0; k<shu.length; k++){
if(shu[k].label == Number(chaiStrArry[j])){
zhongArry.push((shu[k].value));
break ;
}
}
zhongArry.push(wen[j])
}
zhongStr = zhongArry.join(‘’);
return zhongStr;
}else {
return zhongStr;
}
}else {
return zhongStr
}
},