小程序充值允许保留两位小数

This commit is contained in:
lxy 2025-05-08 16:19:20 +08:00
parent d3ba00901f
commit 2e72a23412
2 changed files with 4 additions and 4 deletions

View File

@ -87,9 +87,9 @@ export default OakComponent({
this.onPriceChange(value);
}
else {
const price2 = parseInt(value);
const price2 = Number(value);
if (!isNaN(price2)) {
this.onPriceChange(price2);
this.onPriceChange(Math.round(price2 * 100) / 100);
}
}
},

View File

@ -90,9 +90,9 @@ export default OakComponent({
this.onPriceChange(value);
}
else {
const price2 = parseInt(value);
const price2 = Number(value);
if (!isNaN(price2)) {
this.onPriceChange(price2);
this.onPriceChange(Math.round(price2 * 100) / 100);
}
}
},