javascript中将小数保留两位取出的函数
function formatFloat(src, pos){ return Math.round(src*Math.pow(10, pos))/Math.pow(10, pos);}
formatFloat("1234.5678", 2);