Edit in JSFiddle

var num = 123.456;
$("#r1").append(Math.floor((num * 100)) / 100);
$("#r2").append(num.toFixed(2));
$("#r3").append(num.toPrecision(5));

var str = '123.456';
var pos = str.search(/\./g);
var result = (pos !== -1) ? str.slice(0, pos + 3) : str;
$("#r4").append(result);

var result2 = (pos !== -1) ? str.substr(0, pos + 3) : str;
$("#r5").append(result2);

var result3 = (pos !== -1) ? str.substring(0, pos + 3) : str;
$("#r6").append(result3);

var result4 = (pos !== -1) ? str.match(/^\d+\.\d{2}/g)[0] : str;
$("#r7").append(result4);