因为你的filters是字符串类型,把他转换成浮点类型,或者整型再调用 toFixed()就不会报错了注意 : 用了.toFixed(2) ,这时候的 filters 已经变成的字符串 , typeof filters得出来的是 string ,得用 parseFloat(filters) 转回 数字类型
alert(parseFloat(12.44644).toFixed(2));