JS example of retaining two decimal places and rounding using the function toFixed() <br>document.write("<h1> Example of JS retaining two decimal places</h1><br>");<br> var a=2.1512131231231321;<br> document.write("Original value: "+a+"<br>");<br> document.write("Two decimal points:"+a.toFixed(2)+"<br>Four decimal points"+a.toFixed(4));<br>< ;body>