前端js校验小数点 let result = (value.toString()).indexOf("."); if (result != -1 && value.toString().split(".")[1].length > 8) { return; }