增加部分样式,公共方法,增加保存员工登录保存商户号
This commit is contained in:
@@ -7,9 +7,10 @@
|
||||
* @param {Boolean} returnIsArea - 是否返回值符合范围区间,默认为false。
|
||||
* @returns {number} - 返回格式化后的价格,如果超出范围则返回最小值或最大值。
|
||||
*/
|
||||
export const formatPrice = (price,min=-Infinity, max = 100000000,returnIsArea=false ) => {
|
||||
export const formatPrice = (price,min=-Infinity, max = 100000000,returnIsArea=false,isRerturnNullString=false) => {
|
||||
|
||||
if(price === undefined || price === null||price===''){
|
||||
return 0
|
||||
return isRerturnNullString?'':0
|
||||
}
|
||||
// 将价格转换为浮点数并保留两位小数
|
||||
const newval = parseFloat((Math.floor(price * 100) / 100).toFixed(2))
|
||||
|
||||
Reference in New Issue
Block a user