Knowledge Walls
Laya
Hyderabad, Andhra Pradesh, India
Number.prototype.toFixed() Method in Number Class of Javascript Syntax with Examples
2626 Views
Output 
4568.3
4568.34
4568.346
Syntax 
numberObj.toFixed([digits])
Example
var numObj = 4568.3456;

document.write(numObj.toFixed(1));     
document.write(numObj.toFixed(2));
document.write(numObj.toFixed(3)); 
Usage 
The toFixed() method used to round off number using fixed-point notation.
Best Lessons of "Javascript Syntax with Examples"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details