SOURCE

let num = '415487845.5414';
 function decimalCheckt(str, n,m){
    // 整数最多14位,最多保留6位小数
    var reg = /^(0\.(?!0+$)\d{1,4}|^[1-9][0-9]{0,15}(\.\d{0,4})?)$/;
    var reg1 = /^(0[0-9]*)$/;
    if (reg1.test(str)) {
        return ''
    }
    if (reg.test(str) == true) {
        return str;
    } else {
        return '';
    }
} 
console.log(decimalCheckt(num))
console 命令行工具 X clear

                    
>
console