How can i get just 2 digits after comma in javascript

Solution

var a = 5.017456;
alert(a.toFixed(2));

 

 

 

About the Author

avatar