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