多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

27 lines
623 B

// 分别截取 价格小数点前后的数字
export const PriceFilter = {
// 小数点前
radixPointBefore: price => {
if (price == undefined) {
return
}
price = price.toString()
if (price && price.indexOf(".") != -1) {
return price.substring(0, price.indexOf("."))
} else {
return price;
}
},
// 小数点后
radixPointAfter: price => {
if (price == undefined) {
return
}
price = price.toString()
if (price && price.indexOf(".") != -1) {
return price.substring(price.indexOf("."), price.length)
} else {
return ".00";
}
}
}