common.ts
477 Bytes
/*
* @Description:
* @Author: huyue
* @Date: 2022-10-10 11:37:11
* @LastEditors: huyue
* @LastEditTime: 2024-07-30 18:08:14
*/
/** 三个数字加一个逗号 */
const numAddSymbol = (val: number | string | undefined) => {
return val ? (val + '').replace(/\B(?=(?:\d{3})+\b)/g, ',') : 0
}
// 获取图片
const getImageUrl = (name: any) => {
return new URL(`/` + name + ".png", import.meta.url).href;
};
export {
numAddSymbol,
getImageUrl
}