Фикс регулярки

This commit is contained in:
p.belezov 2024-10-29 14:31:26 +08:00
parent 8ff10a0915
commit 970412b736
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ export default {
if (this.price == ''){
this.price = null;
}
if (typeof this.price == 'string' && /^\d+[\.,\,]?\d+$/.test(this.price)){
if (typeof this.price == 'string' && /^\d+[\.,\,]?\d*$/.test(this.price)){
this.price = parseFloat(this.price)
}
let validateName = rules.notNull(this.name);

View File

@ -35,7 +35,7 @@ export default {
if (this.price == ""){
this.price = null;
}
if (typeof this.price == 'string' && /^\d+[\.,\,]?\d+$/.test(this.price)){
if (typeof this.price == 'string' && /^\d+[\.,\,]?\d*$/.test(this.price)){
this.price = parseFloat(this.price)
}
let validateId = rules.id(this.wish_id);