阿拉伯数字转金额中文大写
function converToZH(numberVal){var ZH_VAL = "零壹贰叁肆伍陆柒捌玖"; // 汉字数字var UNIT = "万仟佰拾亿仟佰拾万仟佰拾元角分"; // 对应单位var n_money = Number(numberVal);var negative = false;if(n_money == 0)return "零元整";if(n_money < 0){negative = true;n_money = -n_money;}var s_money = String(Math.round(n_money*100));var len = s_money.length;var pos = 0;var result = '';var zeroFlag = false;while(pos < len){var num = s_money.charAt(len-pos-1);if(num == '0'){//分位if(pos == 0){}//元、万、亿位 else if(pos == 2 || pos == 6 || pos == 10){if(!zeroFlag)result = UNIT.charAt(UNIT.length-pos-1) + '零' + result;elseresult = UNIT.charAt(UNIT.length-pos-1) + result; }else if(!zeroFlag){result = '零' + result;}zeroFlag = true;}else{zeroFlag = false;result = ZH_VAL.charAt(num) + UNIT.charAt(UNIT.length-pos-1) + result;}pos++;}if(Number(s_money)%10 == 0 || Number(s_money)%100 == 0 ){result = result + '整';}return negative? '负' + result : result;}