说明:来不及细说了,老铁快上车
function fmoney(s, n) {
console.log(s);
n = n > && n <= ? n : ;
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
var l = s.split(".")[].split("").reverse(), r = s.split(".")[];
t = "";
for (i = ; i < l.length; i++) {
t += l[i] + ((i + ) % == && (i + ) != l.length ? "," : "");
}
return t.split("").reverse().join("") + "." + r;
console.log(t.split("").reverse().join("") + "." + r);
}
document.onkeydown=function(e){ var e = e || event; var currKey = e.keyCode || e.which || e.charCode;//支持IE,FireFox if (currKey == ) { return false; } }
enter键取消刷新
$(function () {
$(parent.document).scrollTop(0);//暂存/提交后跳转到页面上方
})