转换成大写金额_i++转换成大写金额_i++_02/**//*

转换成大写金额_git_03===========================================

转换成大写金额_git_03//转换成大写金额

转换成大写金额_git_03===========================================

转换成大写金额_git_06*/

转换成大写金额_git_07Number.prototype.toMoney = function()

转换成大写金额_i++转换成大写金额_i++_02转换成大写金额_i++_10{

转换成大写金额_git_03// Constants:

转换成大写金额_git_03var MAXIMUM_NUMBER = 99999999999.99;

转换成大写金额_git_03// Predefine the radix characters and currency symbols for output:

转换成大写金额_git_03var CN_ZERO= "零";

转换成大写金额_git_03var CN_ONE= "壹";

转换成大写金额_git_03var CN_TWO= "贰";

转换成大写金额_git_03var CN_THREE= "叁";

转换成大写金额_git_03var CN_FOUR= "肆";

转换成大写金额_git_03var CN_FIVE= "伍";

转换成大写金额_git_03var CN_SIX= "陆";

转换成大写金额_git_03var CN_SEVEN= "柒";

转换成大写金额_git_03var CN_EIGHT= "捌";

转换成大写金额_git_03var CN_NINE= "玖";

转换成大写金额_git_03var CN_TEN= "拾";

转换成大写金额_git_03var CN_HUNDRED= "佰";

转换成大写金额_git_03var CN_THOUSAND = "仟";

转换成大写金额_git_03var CN_TEN_THOUSAND= "万";

转换成大写金额_git_03var CN_HUNDRED_MILLION= "亿";

转换成大写金额_git_03var CN_SYMBOL= "";

转换成大写金额_git_03var CN_DOLLAR= "元";

转换成大写金额_git_03var CN_TEN_CENT = "角";

转换成大写金额_git_03var CN_CENT= "分";

转换成大写金额_git_03var CN_INTEGER= "整";

转换成大写金额_git_03 

转换成大写金额_git_03// Variables:

转换成大写金额_git_03var integral; // Represent integral part of digit number.

转换成大写金额_git_03var decimal; // Represent decimal part of digit number.

转换成大写金额_git_03var outputCharacters; // The output result.

转换成大写金额_git_03var parts;

转换成大写金额_git_03var digits, radices, bigRadices, decimals;

转换成大写金额_git_03var zeroCount;

转换成大写金额_git_03var i, p, d;

转换成大写金额_git_03var quotient, modulus;

转换成大写金额_git_03 

转换成大写金额_git_03if (this > MAXIMUM_NUMBER)

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03return "";

转换成大写金额_git_50}

转换成大写金额_git_03 

转换成大写金额_git_03// Process the coversion from currency digits to characters:

转换成大写金额_git_03// Separate integral and decimal parts before processing coversion:

转换成大写金额_git_03

转换成大写金额_git_03 parts = (this + "").split(".");

转换成大写金额_git_03if (parts.length > 1) 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03integral = parts[0];

转换成大写金额_git_03decimal = parts[1];

转换成大写金额_git_03// Cut down redundant decimal digits that are after the second.

转换成大写金额_git_03decimal = decimal.substr(0, 2);

转换成大写金额_git_50}

转换成大写金额_git_03else 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03integral = parts[0];

转换成大写金额_git_03decimal = "";

转换成大写金额_git_50}

转换成大写金额_git_03// Prepare the characters corresponding to the digits:

转换成大写金额_git_03digits= new Array(CN_ZERO, CN_ONE, CN_TWO, CN_THREE, CN_FOUR, CN_FIVE, CN_SIX, CN_SEVEN, CN_EIGHT, CN_NINE);

转换成大写金额_git_03radices= new Array("", CN_TEN, CN_HUNDRED, CN_THOUSAND);

转换成大写金额_git_03bigRadices= new Array("", CN_TEN_THOUSAND, CN_HUNDRED_MILLION);

转换成大写金额_git_03decimals= new Array(CN_TEN_CENT, CN_CENT);

转换成大写金额_git_03

转换成大写金额_git_03 // Start processing:

转换成大写金额_git_03 outputCharacters = "";

转换成大写金额_git_03// Process integral part if it is larger than 0:

转换成大写金额_git_03if (Number(integral) > 0) 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03zeroCount = 0;

转换成大写金额_git_03for (i = 0; i < integral.length; i++) 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03p = integral.length - i - 1;

转换成大写金额_git_03d = integral.substr(i, 1);

转换成大写金额_git_03quotient = p / 4;

转换成大写金额_git_03modulus = p % 4;

转换成大写金额_git_03if (d == "0") 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03zeroCount++;

转换成大写金额_git_50}

转换成大写金额_git_03else 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03if (zeroCount > 0)

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03outputCharacters += digits[0];

转换成大写金额_git_50}

转换成大写金额_git_03zeroCount = 0;

转换成大写金额_git_03outputCharacters += digits[Number(d)] + radices[modulus];

转换成大写金额_git_50}

转换成大写金额_git_03

转换成大写金额_git_03if (modulus == 0 && zeroCount < 4) 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03outputCharacters += bigRadices[quotient];

转换成大写金额_git_50}

转换成大写金额_git_50}

转换成大写金额_git_03

转换成大写金额_git_03outputCharacters += CN_DOLLAR;

转换成大写金额_git_50}

转换成大写金额_git_03

转换成大写金额_git_03// Process decimal part if there is:

转换成大写金额_git_03if (decimal != "") 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03for (i = 0; i < decimal.length; i++) 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03d = decimal.substr(i, 1);

转换成大写金额_git_03if (d != "0") 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03outputCharacters += digits[Number(d)] + decimals[i];

转换成大写金额_git_50}

转换成大写金额_git_50}

转换成大写金额_git_50}

转换成大写金额_git_03

转换成大写金额_git_03// Confirm and return the final output string:

转换成大写金额_git_03if (outputCharacters == "") 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03outputCharacters = CN_ZERO + CN_DOLLAR;

转换成大写金额_git_50}

转换成大写金额_git_03if (decimal == "") 

转换成大写金额_git_46转换成大写金额_i++_47转换成大写金额_i++_10{

转换成大写金额_git_03outputCharacters += CN_INTEGER;

转换成大写金额_git_50}

转换成大写金额_git_03

转换成大写金额_git_03outputCharacters = CN_SYMBOL + outputCharacters;

转换成大写金额_git_03return outputCharacters;

转换成大写金额_git_06}