This commit is contained in:
chashaobao
2025-10-26 22:23:14 +08:00
parent a179654898
commit fde2027588
14 changed files with 104 additions and 34 deletions

View File

@ -81,12 +81,12 @@ export const getProfitList = async (data: GetProfitRequest) => {
return Array.isArray(result) ? result : [];
return [];
};
export const formatMoney = (cents: number) => {
export const formatMoney = (cents: number, fraction = 2) => {
if (!cents) {
return '0';
}
const yuan = cents / 100;
return yuan.toFixed(2);
return yuan.toFixed(fraction);
};
export function formatTimestamp(timestamp: string, dateOnly?: boolean): string {
// 创建 Date 对象