1var myNumber=12.2345;
2var myNumberWithTwoDecimalPlaces=parseFloat(myNumber).toFixed(2); //12.23
1var validate = function(e) {
2 var t = e.value;
3 e.value = (t.indexOf(".") >= 0) ? (t.substr(0, t.indexOf(".")) + t.substr(t.indexOf("."), 3)) : t;
4}