From 7bd0a16660ff88e30bd74f1a34a75d108f779a7d Mon Sep 17 00:00:00 2001 From: farhan048 Date: Thu, 9 Feb 2023 16:39:51 +0700 Subject: [PATCH 1/2] Update Page Presensi Resource --- src/views/SimproV2/Presence/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/SimproV2/Presence/index.js b/src/views/SimproV2/Presence/index.js index 59cebf7..5cefa3e 100644 --- a/src/views/SimproV2/Presence/index.js +++ b/src/views/SimproV2/Presence/index.js @@ -247,8 +247,8 @@ const Index = ({ params }) => { { title: 'Durasi Kerja', render: (text, record) => (
{renderDurasiKerja(record.clock_in, record.clock_out)}
) }, { title: 'Lokasi Masuk', dataIndex: 'clock_in_loc', key: 'clock_in_loc', render: (text, record) => <>{text && text !== '' ? text : '-'} }, { title: 'Lokasi Pulang', dataIndex: 'clock_out_loc', key: 'clock_out_loc', render: (text, record) => <>{text && text !== '' ? text : '-'} }, - { title: 'Area Kerja In', dataIndex: 'clock_out_loc', key: 'clock_out_loc', render: (text, record) => (
{record.clock_in_boundary ? : }
) }, - { title: 'Area Kerja Out', dataIndex: 'clock_out_loc', key: 'clock_out_loc', render: (text, record) => (
{record.clock_out_boundary ? : }
) }, + { title: 'Area Kerja In', dataIndex: 'clock_out_loc', key: 'clock_out_loc', render: (text, record) => (
{record.clock_in_boundary ? : }
) }, + { title: 'Area Kerja Out', dataIndex: 'clock_out_loc', key: 'clock_out_loc', render: (text, record) => (
{record.clock_out_boundary == null ? : record.clock_out_boundary ? : }
) }, ]; return ( Date: Thu, 9 Feb 2023 17:18:23 +0700 Subject: [PATCH 2/2] Fungsi format jutaan, miliaran, dan triliunan --- src/const/CustomFunc.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/const/CustomFunc.js b/src/const/CustomFunc.js index 0fec461..808b6d4 100644 --- a/src/const/CustomFunc.js +++ b/src/const/CustomFunc.js @@ -285,7 +285,17 @@ export const formatThousand = (x) => { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."); } - +export const formatLargeNumber = (num) => { + const formattedNum = formatThousand(num); + if (num >= 1000000000000) { + return `${(num / 1000000000000).toFixed(1)}T`; + } else if (num >= 1000000000) { + return `${(num / 1000000000).toFixed(1)}M`; + } else if (num >= 1000000) { + return `${(num / 1000000).toFixed(1)}Jt`; + } + return formattedNum; +}; /* Using it: sortBy(data, {