保留2位小数
This commit is contained in:
@@ -38,9 +38,9 @@ export default {
|
||||
})
|
||||
},
|
||||
confirm() {
|
||||
if (!/^[0-9]*[1-9][0-9]*$/g.test(this.num)) {
|
||||
if (!/^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/g.test(this.num)) {
|
||||
this.num = ''
|
||||
return this.$u.toast('积分数量请输入正整数')
|
||||
return this.$message.error('积分数量最多只保留两位小数点')
|
||||
}
|
||||
if (this.num > this.total) {
|
||||
return this.$u.toast('转出积分不能大于剩余积分')
|
||||
|
||||
Reference in New Issue
Block a user