• 提现金额需要满足条件js判断


    // 解决首位直接输入 '0开头的数字'问题
    this.inputModel = this.inputModel.toString() + curVal.toString()
    this.inputModel = this.inputModel.replace(/[^d.]/g,""); //清除“数字”和“.”以外的字符
    this.inputModel = this.inputModel.replace(/.{2,}/g,"."); //只保留第一个. 清除多余的
    this.inputModel = this.inputModel.replace(".","$#$").replace(/./g,"").replace("$#$",".");
    this.inputModel = this.inputModel.replace(/^(-)*(d+).(dd).*$/,'$1$2.$3') //保留2位小数
    if(this.inputModel.indexOf(".")< 0 && this.inputModel !=""){//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
    this.inputModel= parseFloat(this.inputModel);
    }
    //判断不能输入最大值
    if(this.maxValue > 0 && this.maxValue < this.inputModel) {
    this.inputModel = this.maxValue
    }
    const inputVal = this.inputModel
    const len = inputVal.length
    if(len == 1 && inputVal.charAt(0) == '.') {
    this.inputModel = ''
    }
    

      

  • 相关阅读:
    jmeter实战
    安卓学习进度_11
    安卓学习进度_10
    安卓学习进度_9
    安卓学习进度_8
    安卓软件学习进度_7
    安卓学习进度_6
    安卓软件学习进度_5
    安卓软件学习进度_4
    安卓软件学习进度_3
  • 原文地址:https://www.cnblogs.com/cyf-1314/p/11477093.html
Copyright © 2020-2023  润新知