}
} else {
vInt = dValue;
vDec = "";
if (NoneDecLen) {
maxDec = 0;
}
}
if (vInt.length > 44) {
return "错误:金额值太大了!整数位长【" + vInt.length.toString() + "】超过了上限——44位/千正/10^43(注:1正=1万涧=1亿亿亿亿亿,10^40)!";
}
// 准备各字符数组 Prepare the characters corresponding to the digits:
digits = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"); // 零~玖
radices = new Array("", "拾", "佰", "仟"); // 拾,佰,仟
bigRadices = new Array("", "万", "亿", "兆", "京", "垓", "杼", "穰", "沟", "涧", "正"); // 万,亿,兆,京,垓,杼,穰,沟,涧,正
decimals = new Array("角", "分", "厘", "毫", "丝"); // 角/分/厘/毫/丝
resAIW = ""; // 开始处理
// 处理整数部分(如果有)
if (Number(vInt) >< vInt.length; i++) {
p = vInt.length - i - 1;
d = vInt.substr(i, 1);
quotient = p / 4;
modulus = p % 4;
if (d == "0") {
zeroCount++;
} else {
if (zeroCount >< 4) {
resAIW += bigRadices[quotient];
}
}
resAIW += "元";
}
// 处理小数部分(如果有)
for (i = 0; i < vDec.length; i++) {
d = vDec.substr(i, 1);
if (d != "0") {

resAIW += digits[Number(d)] + decimals[i];
}
}
// 处理结果
if (resAIW == "") {
resAIW = "零" + "元";
} // 零元
if (vDec == "") {
resAIW += "整";
} // 元整
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/ruanjian/article-46273-2.html
低利息将持续下去