原文参考 逛到一道面试题,数字转大写中文的,搜索学习并记录于此. //自动转换数字金额为大小写中文字符,返回大小写中文字符串,最大处理到999兆 function changeMoneyToChinese( money ) { var cnNums = new Array("零","壹","贰","叁","肆","伍","陆","柒","
function number_chinese(str) { var num = parseFloat(str); var strOutput = "", strUnit = '仟佰拾亿仟佰拾万仟佰拾元角分'; num += "00"; var intPos = num.indexOf('.'); if (intPos >= 0){ num = num.substring(0, intPos) + num.substr(intPos + 1, 2); } st