function Changenummoneytochinese (Money) {
var cnnums = new Array ("0", "one", "II", "three", "premises", "WU", "Lu", "Qi", "ba", "JIU"); Number of Chinese characters
var cnintradice = new Array ("", "Pick", "Bai", "thousand"); Unit
var cnintunits = new Array ("", "Million", "billion", "Mega"); Corresponding integer part expansion unit
var cndecunits = new Array ("Angle", "min", "mm", "CL"); Corresponds to fractional part units
var Cninteger = "whole"; Character followed by integer amount
var cnintlast = "Yuan"; Units after completion of the integer type
var maxnum = 999999999999999.9999; Maximum number of processed
var integernum; Amount of the whole number of parts
var decimalnum; Amount of small part
var chinesestr = ""; Chinese amount string for output
var parts; Array used after separating amount, pre-defined
if (Money = = "") {
Return "";
}
Money = parsefloat (money);
if (Money >= maxnum) {
Alert (' exceeds maximum processing number ');
Return "";
}
if (Money = = 0) {
Chinesestr = Cnnums[0] + cnintlast + cninteger;
return chinesestr;
}
Money = money.tostring (); Convert to String
if (Money.indexof (".") = = =-1) {
Integernum = money;
Decimalnum = ";
} else {
Parts = Money.split (".");
Integernum = Parts[0];
Decimalnum = Parts[1].substr (0, 4);
}
if (parseint (Integernum) > 0) {//Get integral type partial conversion
var zerocount = 0;
var intlen = integernum.length;
for (var i = 0; i < Intlen; i++) {
var n = integernum.substr (i, 1);
var p = intlen-i-1;
var q = P/4;
var m = p% 4;
if (n = = "0") {
zerocount++;
} else {
if (Zerocount > 0) {
Chinesestr + = Cnnums[0];
}
Zerocount = 0; Return to zero
Chinesestr + = Cnnums[parseint (n)] + cnintradice[m];
}
if (m = = 0 && Zerocount < 4) {
Chinesestr + = Cnintunits[q];
}
}
Chinesestr + = Cnintlast;
Integral part processing complete
}
if (decimalnum! = ") {//Decimal part
var declen = decimalnum.length;
for (var i = 0; i < Declen; i++) {
var n = decimalnum.substr (i, 1);
if (n! = ' 0 ') {
Chinesestr + = Cnnums[number (n)] + cndecunits[i];
}
}
}
if (chinesestr = = ") {
Chinesestr + = Cnnums[0] + cnintlast + cninteger;
} else if (Decimalnum = = ") {
Chinesestr + = Cninteger;
}
return chinesestr;
}
0 to 9 of the numbers replaced with 0 to nine uppercase characters of the function