Merge pull request #76 from SDSRV-IDP/fix/fe-issues

Show - for zeros
This commit is contained in:
Đỗ Xuân Tân 2024-03-07 17:05:18 +07:00 committed by GitHub Enterprise
commit 02bf41fd9a

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>
);
},