The value of the regular check can only be two decimal digits
this.value = this.value.replace(/[^\d.]/g, ""); / / retain only Numbers and the ". "this. Value = this. The value, the replace (/ \. {2} / g," "); / / two consecutive ". "retain only the first". "this. Value = this. The value, the replace (".", "$# *"). The replace (/ \. J/g, "). The replace (' $# * ', '. '); / / remove the other ". "this value = this. The value, the replace (/ ^ (\ d +) \. (\ d \ d). * $/, '$1 $2');. If (this.value.indexof (".") < 0 && this.value! This. value = parseFloat(this.value); }Copy the code