Show - for zeros

This commit is contained in:
Viet Anh Nguyen 2024-03-07 17:04:23 +07:00
parent c14b139142
commit 6fbec7df15

View File

@ -1,7 +1,7 @@
import type { TableColumnsType } from 'antd';
import { Table } from 'antd';
import React from 'react';
import { ensureMax, ensureMin, formatPercent } from 'utils/metric-format';
import { ensureMax, ensureMin, formatPercent, formatNumber } from 'utils/metric-format';
interface DataType {
key: React.Key;
@ -224,7 +224,7 @@ const columns: TableColumnsType<DataType> = [
const isAbnormal = ensureMax(record.snImeiAPT, 2);
return (
<span style={{ color: isAbnormal ? 'red' : '' }}>
{record?.snImeiAPT?.toFixed(1)}
{formatNumber(record?.snImeiAPT)}
</span>
);
},
@ -237,7 +237,7 @@ const columns: TableColumnsType<DataType> = [
const isAbnormal = ensureMax(record.invoiceAPT, 2);
return (
<span style={{ color: isAbnormal ? 'red' : '' }}>
{record?.invoiceAPT?.toFixed(1)}
{formatNumber(record?.invoiceAPT)}
</span>
);
},
@ -252,7 +252,7 @@ const columns: TableColumnsType<DataType> = [
render: (_, record) => {
return (
<span>
{formatPercent(record.reviewProgress)==='-'? 0:formatPercent(record.reviewProgress)}
{formatPercent(record.reviewProgress) === '-' ? 0 : formatPercent(record.reviewProgress)}
</span>
);
},