保留两位小数且不四舍五入:
方法一:
var a = 2.461;
var b = ( parseInt( a * 100 ) / 100 ).toFixed(2);
console.log(b); // 2.46
方法二:
var a = -12.45;
var b = parseFloat(a).toFixed(3);
var result = b.substring(0, b.tostring()length-1)
console.log(result) // -12.4