function moveEnd(obj) { obj.focus(); var len = obj.value.length; if (document.selection) { var sel = obj.createTextRange(); sel.moveStart('character', len); sel.collapse(); sel.select(); } else if (typeof obj.selectionStart == 'number' && typeof o
转自https://blog.csdn.net/qiji2011/article/details/81270552 1.js: //保留2位小数,如:2,会在2后面补上00.即2.00 function toDecimal2(x) { var f = parseFloat(x); if (isNaN(f)) { return false; } var f = Math.round(x * 100) / 100; var s = f.toString()