万亿级别,这个还有bug的
function money2Uppercase(num) {
var m = parseInt(num);
var ml = (m.toString()).split('');
var wlist = ['', '十', '百', '千', '万', '十', '百', '千', '亿', '十', '百', '千', '万'];
var numlist = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', ];
var cmlist = wlist.slice(0, ml.length);
cmlist = cmlist.reverse();
var result = '';
for (var i = 0; i < ml.length; i++) {
result += numlist[ml[i]] + (ml[i] == 0? '': cmlist[i])
}
return result;
}
console.log(money2Uppercase(10112030123));