import { floatToFixed2 } from '@/utils' // 格式化金额【分转元】 // @ts-ignore export const fenToYuanFormat = (_, __, cellValue: any, ___) => { return `¥${floatToFixed2(cellValue)}` } /** 数字格式化为两位小数 */ const formatNumber = (row: any, column: any, cellValue: any) => { if (cellValue === null || cellValue === undefined) { return '-' } // 确保是数字类型后再格式化 const num = Number(cellValue) if (isNaN(num)) { return cellValue } return num.toFixed(2) }