Create Number object : Number Constructors : Number Data Type JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Number Data Type » Number Constructors »

 

Create Number object

















<html>
<head>
<title>Demonstrating the toPrecision() method</title>
<script type="text/javascript" language="javascript">
<!-- //
function DisplayPrecision(){
    number = new Number(1200000000003);
    for (var i=1; i<8; i++){
        document.write(number.toPrecision(i));
    }
}
// -->
</script>
</head>
<body onload="DisplayPrecision()">
<P>This listing demonstrates the use of the toPrecision() method.</p><br />
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Number Data Type
» Number Constructors