degree measurement conversion--area conversion

Source: Internet
Author: User
Tip: You can modify some of the code before running

<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <title> degree Measurement conversion--area conversion </title> <script language=jscript type=text/jscript> <!- -function Area_measures () {This.msquare_kilometer = (1000 * 1000) This.mhectare = (MB) this.m Square_meter = 1 This.mare = ((10000/15) * this.msquare_meter) This.msquare_decimeter = (0.1 * 0.1) This.msquare_cen Timeter = (0.01 * 0.01) This.msquare_millimeter = (0.001 * 0.001) This.engsquare_foot = (0.3048 * 0.3048) THIS.ENGSQ Uare_yard = (3 * 3 * this.engsquare_foot) This.ussquare_rod = (16.5 *16.5 * this.engsquare_foot) this.engacre = 160 * This.ussquare_rod this.engsquare_mile = (5280 *5280 * this.engsquare_foot) This.engsquare_inch = (this.engSquare_foot /(*)} var area_data = new Area_measures (); function Checknum (str) {for (var i=0 i<str.length; i++) {var ch = str.substring (i, i + 1) if (ch!= "." &A mp;& ch!= "+"&& ch!="-"&& ch!=" E "&& ch!=" E "&& (Ch <" 0 "| | | ch >" 9 ")) {alert (" Please enter Valid number "); return false; } return True} function normalize (what,digits) {var str= "" +what; var Pp=math.max (Str.lastindexof ("+"), Str.lastindexof ("-")); var idot=str.indexof ("."); if (idot>=1) {var ee= (pp>0)? Str.substring (Pp-1,str.length): ""; Digits+=idot; if (digits>=str.length) return str; if (pp>0 && digits>=pp) digits-=pp; var c=eval (Str.charat (digits)); var ipos=digits-1; if (c>=5) {while (Str.charat (ipos) = = "9") ipos--; if (Str.charat (ipos) = = ".") {var nc=eval (str.substring (0,idot)) +1; if (nc==10 && ee.length>0) {nc=1; Ee= "E" + (eval (ee.substring (1,ee.length)) +1); Return "" +NC+EE; Return str.substring (0,ipos) + (eval (Str.charat (IPOs)) +1) +ee; } ElSE var ret=str.substring (0,digits) +ee; For (Var i=0. i<ret.length; i++) if (Ret.charat (i) > "0" && ret.charat (i) <= "9") return re T return str; return str; } function Compute (obj,val,data) {if (obj[val].value) {var uval=0; Uval = Obj[val].value*data[val]; if ((uval >= 0) && (obj[val].value.indexof ("-")!=-1)) {uval =-uval; Hack for Opera 4.0 2000-10-14} for (var i in data) obj[i].value=normalize (uval/data[i],8); } function Resetvalues (Form,data) {for (var i in data) form[i].value= "";} function Resetall (form) {resetvalues (form,area_data); //--> </SCRIPT> </pead> <body class= "BodyColor" topmargin= "2" > <table width= "100%" border= "0" cellpadding=0 cellspacing=0 class= "small" > <TBODY> <TR> <td align= "center" valign= "Top" ; <form action= "" > <br> <table width= "75%" align= "center" cellpadding=4 cellspacing=0 class= "small" > <TBODY> <TR> <td colspan= "6" > can realize square kilometer (km<sup>2</sup>), ha (ha), mu, square meters (m<sup>2</sup>), square decimeter (dm<sup>2</sup>), square centimeter (cm<sup>2</sup>), square mm (Mm<SUP >2</SUP>), Square mile (sq mi), acre, square pole (Sq rd), square yd, square feet (sq ft), and reciprocal interchange between square inches (sq in). </TD> </TR> <TR> <td colspan= "6" > </t d> </TR> <TR> <td align=right nowrap> sq km (KM&L T sup>2</sup>) </TD> <td align=left><input name=msqu Are_kilometer class= "Smallinput" size=15></td> <td align=left><input onclick= "if" (Chec Knum (Msquare_kilometer.value)) Compute (This.form,msquare_kilometer.name,Area_data) "Type=button value= conversion class= ' Smallbutton ' name=msquare_kilometer_bt></td> <TD A Lign=right nowrap> ha (ha) </TD> <td align=left><input name=mhectare class= "Smallinput" s ize=15></td> <td align=left><input onclick= "if (Checknum (Mhectare.value)) compute (This . Form,mhectare.name,area_data) "Type=button value= conversion class= ' Smallbutton ' name=mhectare_bt></td> </TR> <TR> <td align=right nowrap> mu </TD> ; TD align=left><input name=mare class= "Smallinput" size=15></td> <td INPUT onclick= "if (Checknum (Mare.value)) Compute (this.form,mare.name,area_data)" Type=button value= conversion class= ' Smallbutton ' name=mare_bt></td> <td align=right nowrap> square meters (m<sup>2</sup>) ;/td> &LT;TD ALign=left><input name=msquare_meter class= "Smallinput" size=15></td> &LT;TD align=left><input onclick= "If" (Checknum (Msquare_meter.value)) Compute (this.form,msquare_meter.name,a Rea_data) "Type=button value= conversion class= ' Smallbutton ' name=msquare_meter_bt></td> </TR> <TR> <td align=right nowrap> Square decimeter (dm<sup>2</sup>) </TD> &LT;TD align=left><input name=msquare_decimeter class= "Smallinput" size=15 ></TD> <td align=left><input onclick= "if (Checknum (Msquare_decimeter.value)) compute (t His.form,msquare_decimeter.name,area_data) "Type=button value= conversion class= ' Smallbutton ' name=mSquare_decimeter_bt> </TD> <td align=right nowrap> Square centimeter (cm<sup>2</sup>) </TD> & Lt TD Align=left><input Name=msquare_centimeter class= "Smallinput" size=15></td> <td Align=left><input onclick= "If" (Checknum (Msquare_centimeter.value)) Compute (this.form,msquare_ Centimeter.name,area_data) "Type=button value= conversion class= ' Smallbutton ' name=msquare_centimeter_bt></td> </TR> <TR> <td align=right nowrap> square mm (MM&LT;SUP&GT;2&LT;/SUP&G t;) </TD> &LT;TD align=left><input name=msquare_millimeter CLA ss= "Smallinput" size=15></td> <td align=left><input onclick= "if (checknum Imeter.value)) Compute (this.form,msquare_millimeter.name,area_data) "Type=button value= conversion class= ' SmallButton ' name= msquare_millimeter_bt></td> <td align=right nowrap> square mile (sq mi) </TD> &LT;TD Align=left><input Name=engsquare_mile class= "Smallinput" size=15></td> <td align=left><input Onclick= "if (Checknum (Engsquare_mile.value)) Compute (this.form,engsquare_mile.name,area_data)" Type=button value= Conversion class= ' Smallbutton ' name=engsquare_mile_bt></td> </TR> <TR> &LT;TD align=right nowrap> Acres </TD> <td align=left><input CLA ss= "Smallinput" size=15></td> <td align=left><input onclick= "if (checknum e) Compute (this.form,engacre.name,area_data) "Type=button value= conversion class= ' Smallbutton ' name=engacre_bt></td > <td align=right nowrap> Square Pole (Sq rd) </TD> <td align=left><input Name=ussquare_rod class= "Smallinput" size=15></td> <td align=left><input onclick= "if (Checknum (ussquare_rod.value)) compute(this.form,ussquare_rod.name,area_data) "Type=button value= conversion class= ' Smallbutton ' name=ussquare_rod_bt></td > </TR> <TR> <td align=right nowrap> Square Code (sq yd) </ td> <td align=left><input name=engsquare_yard class= "Smallinput "Size=15></td> <td align=left><input onclick=" if (Checknum (engsquare_yard.value)) com Pute (this.form,engsquare_yard.name,area_data) "Type=button value= conversion class= ' Smallbutton ' name=engSquare_yard_bt> </TD> <td align=right nowrap> square feet (sq ft) </TD> <td align=left>& Lt;input name=engsquare_foot class= "Smallinput" Size=15></td> < TD align=left><input onclick= "If" (Checknum (Engsquare_foot.value)) Compute (This.form,engsquare_foot.name,area _data) "Type=button value= conversion class= ' smallbutTon ' name=engsquare_foot_bt></td> </TR> <TR> <t D align=right nowrap> Square inch (sq in) </TD> <td align=left><input Name=engsquare_inch class= "Smallinput" size=15></td> <td align=left><input onclick= "If (Checknum (Engsquare_inch.value)) Compute (this.form,engsquare_inch.name,area_data)" Type=button value= conversion class= ' Smallbutton ' name=engsquare_inch_bt></td> <td colspan=3></td> < /tr> </TBODY> </TABLE> <br> <div align= "Center" & Gt <input Onclick=resetall (this.form) Type=button value= data reset class= ' Smallbutton ' name=res7> </div> </FORM></TD> </TR> </TBODY> </TABLE> </body> </ptml>
Tip: You can modify some of the code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.