//「人幣金額轉大寫程式Bardo QI
function numToCny(num){
var capUnit = ['萬','億','萬','圓','']; ['角','分',''], 4:['仟','佰','拾','']};
var capNum=['零','壹','貳','叁','肆','伍','陸','柒','捌','玖'];
if (((num.toString()).indexOf('.' ) > 16)||(isNaN(num)))
return '';
(Math .pow(10,19-num.length)).toString()).substring(1) num;
var i,ret,j,nodeNum,k,subret,len,subChr,CurChr=[]; 🎜> for (i=0,ret='';i 🎜> for(k=0,subret='',len=nodeNum.length;((k
]==CurChr[1]) && (CurChr[0]==capNum[0])))
') && (ret=='')))
subret = CurChr[k% subChr = subret ((subret=='')?'':capUnit[i] );
if(!((subChr == capNum[0]) && (ret==''))) ret=(ret=='' )? capNum[0] capUnit[3]: ret;
return ret;
}
}
}