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