var n = 3.156448; //toString 转换字符串类型 //split() 分割成字符串数组 //获取索引为1也就是小数点后的数 var s = n.toString().split(".")[1]; alert(s);