feat:
This commit is contained in:
@ -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 对象
|
||||
|
||||
Reference in New Issue
Block a user