javascript function block two decimal places code example
Example 1: javascript show 2 decimal places
var myNumber=12.2345;
var myNumberWithTwoDecimalPlaces=parseFloat(myNumber).toFixed(2); //12.23
Example 2: javascript two decimal places after division
Math.round(num * 100) / 100
//OR to be more specific and to ensure things like 1.005 round correctly, use Number.EPSILON :
Math.round((num + Number.EPSILON) * 100) / 100