Convert the number to uppercase renminbi, there are many methods, this example is to use JS to complete, look at the following implementation code
function Changenummoneytochinese (Money) {
var cnnums = new Array ("0", "one", "II", "three", "Restaurant", "WU", "Lu", "Qi", "ba", "Nine"); Number of Chinese characters
var cnintradice = new Array ("", "Pick Up", "Bai", "Qian"); Unit
var cnintunits = new Array ("", "Million", "billion", "Mega"); Corresponding integer part expansion unit
var cndecunits = new Array ("Angle", "min", "Penny", "pct"); corresponding to the fractional part of the unit
var Cninteger = "whole"; The character following the integer amount
var cnintlast = "Yuan"; Units after the integral type
var maxnum = 999999999999999.9999; Maximum number of processed
var integernum; Amount of the whole number of parts
var decimalnum; Amount of small Parts
var chinesestr = ""; Chinese amount string for output
var parts; The array to use after separating the amount, predefined
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 partial conversions
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;
}