/*
 * @Author: code4eat awesomedema@gmail.com
 * @Date: 2022-12-14 14:14:32
 * @LastEditors: code4eat awesomedema@gmail.com
 * @LastEditTime: 2024-09-06 14:32:14
 * @FilePath: /BudgetManaSystem/src/utils/format.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 示例方法，没有实际意义
export function trim(str: string) {
  return str.trim();
}

//金额数字转换
export function formatMoneyNumber(num: number) {
  if (typeof num !== 'number' || isNaN(num)) {
    return num;
  }
  return new Intl.NumberFormat('en-US', {
    minimumFractionDigits: 2,
    maximumFractionDigits: 2,
  }).format(num);
}
