Convert a number to a precision : Number « Javascript Objects « JavaScript DHTML






Convert a number to a precision

 
    
<html>
<body>
<button onclick="var myNum = new Number(100); alert(myNum.toPrecision(1));">
Number toPrecision
</button>
</body>
</html>

    
      
        
  








Related examples in the same category

1.Fix a number
2.Number.MAX_VALUE
3.Number.MIN_VALUE
4.Number.NEGATIVE_INFINITY
5.Number.POSITIVE_INFINITY
6.Number.toExponential()
7.Number.toPrecision()
8.Number.toFixed()
9.Convert a Number to a Exponential format