提现
This commit is contained in:
@@ -57,6 +57,21 @@ export default {
|
||||
typeof func === 'function' && func()
|
||||
}, wait)
|
||||
}
|
||||
},
|
||||
checkInputPrice(value,max = null) {
|
||||
if(max === 0){
|
||||
return '';
|
||||
}
|
||||
// value = value.replace(/^0*/g, ''); // 第一个数不能为0 ,若为0替换为空
|
||||
value = value.replace(/[^\d.]/g, ""); // 是否是数字 和小数点,若是除数字 和小数点之外的则替换为空
|
||||
value = value.replace(/^\./g, ""); // 确证第一个为数字而不是“.”
|
||||
value = value.replace(/\.{2,}/g, "."); // 只能输入一个“.”
|
||||
value = value.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."); // 保证”.“只出现一次,而不能出现两次以上
|
||||
value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); // 只能输入两个小数
|
||||
if(max && value >= max){
|
||||
value = max;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user