//num is the lowercase amount, the Unit elementChangemoney (num) {if(IsNaN (num))return""; varStrprefix= ""; if(num<0) Strprefix = "(negative)"; Num=math.abs (num); if(num>=1000000000000)return""; varStroutput = ""; varstrunit = ' Qian Bai hundred billion thousand to pick up thousand hundred yuan angle points '; varStrcapdgt= ' 0 One and three Woolu qi Ba Jiu '; //convert units to minutesnum + = "00"; varintpos = Num.indexof ('. ')); if(intpos >= 0) {num= num.substring (0, Intpos) + num.substr (intpos + 1, 2); } strunit= Strunit.substr (Strunit.length-num.length); for(vari=0; i < num.length; i++) {Stroutput+ = Strcapdgt.substr (Num.substr (i,1), 1) + STRUNIT.SUBSTR (i,1); } returnStrprefix+stroutput.replace (/Certer $/, ' whole '). Replace (/0 [Bai]/g, ' 0 '). Replace (/0 {2,}/g, ' 0 '). Replace (/0 ([million])/g, ' $ ' ). Replace (/0 + yuan/, ' meta '). Replace (/billion zero {0,3} million/, ' billion '). Replace (/^ yuan/, "0 yuan")); },
JavaScript converts lowercase amounts to uppercase