去除在保留两位小数时的四舍五入
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user