b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

金额大小写转换_金额大小写规范_excel金额小写转大写(5)

电脑杂谈  发布时间:2017-05-10 11:13:49  来源:网络整理

}

// 准备各字符数组 Prepare the characters corresponding to the digits:

digits = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"); // 零~玖

radices = new Array("", "拾", "佰", "仟"); // 拾,佰,仟

bigRadices = new Array("", "万", "亿", "兆", "京", "垓", "杼", "穰", "沟", "涧", "正"); // 万,亿,兆,京,垓,杼,穰,沟,涧,正

decimals = new Array("角", "分", "厘", "毫", "丝"); // 角/分/厘/毫/丝

resAIW = ""; // 开始处理

// 处理整数部分(如果有)

if (Number(vInt) > 0) {

zeroCount = 0;

for (i = 0; i < 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 > 0) {

resAIW += digits[0];

}

zeroCount = 0;

resAIW += digits[Number(d)] + radices[modulus];

}

if (modulus == 0 && 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 += "整";

} // 元整

resAIW = CN_SYMBOL + minus + resAIW; // /负元角分/整

return resAIW;


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/ruanjian/article-46273-5.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    每日福利
    热点图片
    拼命载入中...