Determine whether the monthly rental input is a number
function Setdefaultvalueinerror () {
var yzj = document.getElementById ("Ctl00_contentplaceholder2_radtextbox11_text");//Get Source
var tmpv = "";
if (YZJ! = null) {
TMPV = Yzj.value;
if (IsNaN (TMPV)) {
TMPV = 0;
}
}
document.getElementById ("Ctl00_contentplaceholder2_radtextbox11_text"). Value = tmpv;//Sets the values of the control (lowercase)
Getvaluea (TMPV);
}
Get the number on each bit
Function Getvaluea (TMPV) {
var yjz = moneycn (parsefloat (TMPV));
var b, S, Y, J;
var a = "Bai";
var a1 = "Pickup";
var a2 = "Circle";
var a3 = "angle";
var a4 = "points";
B = yjz.tostring (). Split (A.tostring (). Split (")). length > 1? yjz.tostring (). Split (A.tostring (). Split (")) & nbsp , &NB Sp , &NB Sp [0].substring (Yjz.tostring (). Split (A.tostring (). Split (")) [0].length-1]:" 0 "; , &NB Sp , &NB Sp
s = yjz.tostring (). Split (A1.tostring (). Split (")). length > 1? Yjz.tostring (). Split (A1.tostring (). Split (")) [0].substring (Yjz.tostring (). Split (A1.tostring (). Split (")) [0].length-1]:" 0 ";
y = yjz.tostring (). Split (A2.tostring (). Split (")). length > 1? Yjz.tostring (). Split (A2.tostring (). Split (")) [0].substring (Yjz.tostring (). Split (A2.tostring (). Split (")) [0].length-1]:" 0 ";
j = yjz.tostring (). Split (A3.tostring (). Split (")). length > 1? Yjz.tostring (). Split (A3.tostring (). Split (")) [0].substring (Yjz.tostring (). Split (A3.tostring (). Split (")) [0].length-1]:" 0 ";
f = yjz.tostring (). Split (A4.tostring (). Split (")). length > 1? Yjz.tostring (). Split (A4.tostring (). Split (")) [0].substring (Yjz.tostring (). Split (A4.tostring (). Split (")) [0].length-1]:" 0 ";
if (y = = "Pick" | | y = "Bai") {
y = "0";
}
if (y = = "one") {
y = "one";
}
The corresponding assignment can be made here.
.......
.......
}
Convert uppercase Functions
function Moneycn (number) {
if (number = = 0) {
return "0";
}
var Result = convertnumbertocase (number);//Conversion standard
alert (Result);
Result = result.tostring (). Replace ("A", "one");
Result = result.tostring (). Replace ("Two", "II");
Result = result.tostring (). Replace ("three", "triple");
Result = result.tostring (). Replace ("Four", "premises");
Result = result.tostring (). Replace ("Five", "WU");
Result = result.tostring (). Replace ("VI", "Lu");
Result = result.tostring (). Replace ("Seven", "Qi");
Result = result.tostring (). Replace ("Eight", "BA");
Result = result.tostring (). Replace ("Nine", "JIU");
Result = result.tostring (). Replace ("Nine", "JIU");
Result = result.tostring (). Replace ("Ten", "Pick up");
Result = result.tostring (). Replace ("Hundred", "Bai");
Result = result.tostring (). Replace ("Thousand", "thousand");
alert (Result);
Result = result.tostring (). Replace ("A", "one");
Result = result.tostring (). Replace ("Two", "II");
Result = result.tostring (). Replace ("three", "triple");
Result = result.tostring (). Replace ("Four", "premises");
Result = result.tostring (). Replace ("Five", "WU");
Result = result.tostring (). Replace ("VI", "Lu");
Result = result.tostring (). Replace ("Seven", "Qi");
Result = result.tostring (). Replace ("Eight", "BA");
Result = result.tostring (). Replace ("Nine", "JIU");
Result = result.tostring (). Replace ("Nine", "JIU");
Result = result.tostring (). Replace ("Ten", "Pick up");
Result = result.tostring (). Replace ("Hundred", "Bai");
Result = result.tostring (). Replace ("Thousand", "thousand");
Result = result.tostring (). Replace ("A", "one");
if (Result.tostring (). Split ("dot")! = null && result.tostring (). Split ("point"). Length >= 2) {
var P = result.tostring (). IndexOf ("point");
Result = result.tostring (). push (P + 2, "angle");
Result = result.tostring (). Replace ("point", "Circle");
Result = result.tostring (). replace ("angle", "angle");
Result = result.tostring (). Replace ("0 points", "");
Result = result.tostring (). Replace ("0 angle", "" ");
Result = result.tostring (). replace ("Split angle", "" ");
if (result.tostring (). substring (0, 2) = = "0 Circle") {
Result = Result.replace ("0 Circle", "");
}
}
else {
Result + = "rounding";
}
result = "RMB" + result;
return Result;
}
Convert capitalization criteria
function Convertnumbertocase (number) {
var CPOINTCN = "Point CFC";
var CNUMBERCN = "0123456789";
if (number = = "0") {
Return "" + cpointcn.substring (0, 1);
}
if (Number.tostring (). Split ('. ')! = null && number.tostring (). Split ('. '). Length < 2) {
Number + = ".";
}
var P = number.tostring (). IndexOf (".");
var Result = "";
for (var i = 0; i < number.tostring (). length; i++) {
if (P = = i) {
Result = result.tostring (). Replace ("10", "0");
Result = result.tostring (). Replace ("0", "0");
Result = result.tostring (). Replace ("0", "0");
Result = result.tostring (). Replace ("10", "0");
Result = result.tostring (). Replace ("0", "0");
Result = result.tostring (). Replace ("0", "0");
Result = result.tostring (). Replace ("0", "million");
Result = result.tostring (). Replace ("0", "billion");
Result = result.tostring (). Replace ("Billions", "billion");
Result = result.tostring (). Replace ("0 point", "point");
}else {
if (P > i) {
Result + = "" + cnumbercn.substring (number.tostring (). substring (i, i + 1), parseint (number.tostring (). substring (i, i + 1), + 1) + cpointcn.substring (p-i-1, p-i);
}
else {
var n = i-p;
Switch (n) {
Case 1:
Result + = "" + cnumbercn.substring (number.tostring (). substring (i, i + 1), parseint (number.tostring (). substring (i, i + 1), 10) + 1) + "angle";
Break
Case 2:
Result + = "" + cnumbercn.substring (number.tostring (). substring (i, i + 1), parseint (number.tostring (). substring (i, i + 1), 10) + 1) + "min";
Break
Default
Result + = "" + cnumbercn.substring (number.tostring (). substring (i, i + 1), parseint (number.tostring (). substring (i, i + 1), 10) + 1);
Break
}
Result = result.tostring (). Replace ("0 angle", "angle");
Result = result.tostring (). Replace ("0 points", "min");
}
}
}
if (result.tostring (). substring (result.tostring (). Length-1, 1) = = "" + cpointcn.substring (0,1)) {
Result = result.tostring (). Remove (result.length-1); One point, one
}
if (result.substring (0, 1) = = cpointcn.substring (0, 1)) {
result = cnumbercn.substring (0, 1) + result; Point three-0.3
}
if (result.tostring (). Length > 1) && (result.substring (1, 2) = = Cpointcn.substring (1, 2)) && (result.substring (0, 1) = = Cnumbercn.substring (1, 2))) {
Result = result.tostring (). Remove (0, 1); 13-13
}
alert (Result);
return Result;
}
Use JS for numeric case conversions