JavaScript displaying a float to 2 decimal places

Solution 1:

float_num.toFixed(2);

Note:toFixed() will round or pad with zeros if necessary to meet the specified length.

Solution 2:

You could do it with the toFixed function, but it's buggy in IE. If you want a reliable solution, look at my answer here.