benjamincharity
6/16/2015 - 10:39 AM

Force number to show two decimal places (with rounding). Source: http://stackoverflow.com/questions/6134039/format-number-to-always-show-2-

Force number to show two decimal places (with rounding).

Source: http://stackoverflow.com/questions/6134039/format-number-to-always-show-2-decimal-places

var input = 4.537;
var result = parseFloat(Math.round(num3 * 100) / 100).toFixed(2); // 4.54