feature(uniapp商品): 商品功能完善

This commit is contained in:
luowenfeng
2022-09-01 15:28:05 +08:00
parent 198b1189e8
commit ab6fd30551
9 changed files with 84 additions and 398 deletions

View File

@ -222,3 +222,17 @@ export function getPath(path) {
}
return basePath + path;
}
/**
* 除法保留两位小数
*
* @param {*} divisor 除数
* @param {*} dividend 被除数
* @returns
*/
export function divide(divisor, dividend) {
if(divisor == null || dividend == null || dividend == 0){
return null;
}
return Math.floor(divisor/dividend*100)/100;
}