JavaScript Round 2 Digit
var numb = 123.23454;
numb = numb.toFixed(2);
Strange Snake
var numb = 123.23454;
numb = numb.toFixed(2);
let pi = 3.141;
let rounded = pi.toFixed(1);
console.log(rounded); //output: 3.1
var subTotal="12.1345";// can also be int, float, string
var subTotalFormatted=parseFloat(subTotal).toFixed(2); //"12.13"
Math.round((num + Number.EPSILON) * 100) / 100
//HazaaZOOZ - javascript - How to use limit input to 2 decimal places
var validate = function(e) {
var t = e.value;
e.value = (t.indexOf(".") >= 0) ? (t.substr(0, t.indexOf(".")) + t.substr(t.indexOf("."), 3)) : t;
}