问题补充说明:如我输入100.999后应该显示101.00,对应大写也是壹百零壹元整。各位大神 如果采纳后继续追加10分!!
functionmoney(mon){
varsmon=Math.r越ound(mon*100);
varsplot=smon%100;
varzheng=p位牛继轮属航带arseInt(smon/100);
varch_key=newArray('零','壹','贰','叁','肆','伍','陆','柒','捌','玫');
vardan_key=newArray('拾','佰','仟','万','拾万','百万','仟万','亿');
varstr_num=zh害利当厚eng+'';
varlen=str_num.length;
varslen=len-1;
varrs=''
for(vari=0;i varch=par有题即急seInt(str_num.charAt(i)); rs+=ch_key[ch]; slen--; if(ch>0&&slen>=0)rs+=dan_key[slen]; } if(splot==0){ rs+='元整'; }else{ varstr=splot+''; varch=pa群季义率何资眼齐强外检rseInt(str.charAt(0)); rs+='点'+ch_key[ch]; ch=parseInt(str.charAt(1)); rs+=ch_key[ch]+'元'; } returnrs; } alert(money(211199.999));