Number toFixed()
The toFixed() method returns a string representation of a number with a specified number of decimal points.
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<script type="text/javascript">
var num = 10;
document.writeln(num.toFixed(2)); //"10.00"
</script>
</head>
<body>
</body>
</html>
The rounding nature of toFixed()
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<script type="text/javascript">
var num = 10.005;
document.writeln(num.toFixed(2)); //"10.01"
</script>
</head>
<body>
</body>
</html>