function FormatNumber(n) {
n += "";
var arr = n.split(".");
var re = /(\d{1,3})(?=(\d{3})+$)/g;
return arr[0].replace(re,"$1,") + (arr.length == 2 ? "."+arr[1] : "");
}
//取消千分位:
nn = parseInt(v_p.replace(",",""),10);
//test
document.write("1234567 -> " + FormatNumber(1234567) + "<br>");
document.write("12345678.12 -> " + FormatNumber("12345678.12") + "<br>");
document.write("123456789.1234 -> " + FormatNumber(123456789.1234) + "<br>");
document.write("-123456.123 ->" + FormatNumber(-123456.123) + "<br>");