javascript round to 2 decimal places
snippet in javascript

javascript round decimal 2 digits

user8615

var numb = 123.23454;
numb = numb.toFixed(2);

javascript round to 2 decimal places

user1022

var subTotal="12.1345";// can also be int, float, string
var subTotalFormatted=parseFloat(subTotal).toFixed(2); //"12.13"

javascript snumber two decimal places as string

user9355

let money = 1.6;

money.toFixed(2); // 1.60

javascript round to 2 digits

user7350

var num = 2;
var roundedString = num.toFixed(2);// 2.00

round number 2 decimals javascript

user4438

Math.round((num + Number.EPSILON) * 100) / 100