Javascript 4 : Konversi Tipe Data

Selasa, 26 Februari 2019

Javascript 4 : Konversi Tipe Data


Konversi Tipe Data



7. Script :

<HTML>
<HEAD>
<TITLE>Konversi Bilangan</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE = "JavaScript">
var a = parseInt("27");
   
document.write("1. " + a + "<BR>");
   a = parseInt("27.5");
   document.write("2. " + a + "<BR>");
   var a = parseInt("27A");
   document.write("3. " + a + "<BR>");
            a = parseInt("A27.5");
   document.write("4. " + a + "<BR>");
   var b = parseFloat("27");
   document.write("5. " + b + "<BR>");
            b = parseFloat("27.5");
   document.write("6. " + b + "<BR>");
   var b = parseFloat("27A");
   document.write("7. " + b + "<BR>");
           b = parseFloat("A27.5");
   
document.write("8. " + b + "<BR>")
//-->
</SCRIPT>
</BODY>
</HTML>



0 komentar :

Posting Komentar