保留2位小数

This commit is contained in:
liuye
2023-07-18 17:59:13 +08:00
parent 02631bc1ac
commit c0e4e2d0f7

View File

@@ -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('转出积分不能大于剩余积分')