This commit is contained in:
YeMingfei666 2024-07-25 14:57:01 +08:00
commit fa84f836ed
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ export const formatPrice = (price,min=-Infinity, max = 100000000,returnIsArea=fa
return 0
}
// 将价格转换为浮点数并保留两位小数
const newval = parseFloat(price.toFixed(2))
const newval = parseFloat((Math.floor(price * 100) / 100).toFixed(2))
// 如果价格大于最大值,返回最大值
if (newval > max) {
return returnIsArea?{value:max,error:true}:max