You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { fenToYuan } from '@/utils'
|
|
|
|
import { TableColumnCtx } from 'element-plus'
|
|
|
|
|
|
|
|
// 格式化金额【分转元】
|
|
|
|
export const fenToYuanFormat = (
|
|
|
|
row: any,
|
|
|
|
column: TableColumnCtx<any>,
|
|
|
|
cellValue: any,
|
|
|
|
index: number
|
|
|
|
) => {
|
|
|
|
return `¥${fenToYuan(cellValue)}`
|
|
|
|
}
|
|
|
|
export const accountantFormart = (row, column, cellValue) => {
|
|
|
|
cellValue = cellValue + '' || ''
|
|
|
|
let x = cellValue.split('.')
|
|
|
|
let x1 = x[0]
|
|
|
|
let x2 = x.length > 1 ? '.' + x[1] : ''
|
|
|
|
const reg = /(\d+)(\d{3})/
|
|
|
|
while(reg.test(x1)){
|
|
|
|
x1 = x1.replace(reg, '$1,$2')
|
|
|
|
}
|
|
|
|
return x1+x2
|
|
|
|
}
|