Refactor number formatting in Vue components

This commit is contained in:
Dede Fuji Abdul
2024-03-21 11:27:35 +07:00
parent d39e8c9d7f
commit 9fdf086eeb
44 changed files with 545 additions and 628 deletions

View File

@@ -177,28 +177,28 @@
summary-type="sum"
display-format="{0}"
css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(parseFloat(e.value.toString()))"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxTotalItem
column="sla_gangguan"
summary-type="sum"
display-format="{0}"
css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(parseFloat(e.value.toString()))"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxTotalItem
column="avg_durasi_recovery_keluhan"
summary-type="sum"
display-format="{0}"
css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(parseFloat(e.value.toString()))"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxTotalItem
column="sla_keluhan"
summary-type="sum"
display-format="{0}"
css-class="text-white !text-right"
:customize-text="(e: any) => formatNumber(parseFloat(e.value.toString()))"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxTotalItem
column="aging_complaint_gangguan"
@@ -206,10 +206,7 @@
display-format="{0}"
css-class="text-white !text-right"
:customize-text="
(e: any) =>
parseFloat(e.value.toString())
? formatPercentage(parseFloat(e.value.toString()))
: '0%'
(e: any) => (parseFloat(e.value.toString()) ? formatPercentage(e.value) : '0%')
"
/>
<DxTotalItem
@@ -218,10 +215,7 @@
display-format="{0}"
css-class="text-white !text-right"
:customize-text="
(e: any) =>
parseFloat(e.value.toString())
? formatPercentage(parseFloat(e.value.toString()))
: '0%'
(e: any) => (parseFloat(e.value.toString()) ? formatPercentage(e.value) : '0%')
"
/>
<DxTotalItem
@@ -230,10 +224,7 @@
display-format="{0}"
css-class="text-white !text-right"
:customize-text="
(e: any) =>
parseFloat(e.value.toString())
? formatPercentage(parseFloat(e.value.toString()))
: '0%'
(e: any) => (parseFloat(e.value.toString()) ? formatPercentage(e.value) : '0%')
"
/>
@@ -245,7 +236,7 @@
column="avg_durasi_recovery_gangguan"
summary-type="sum"
display-format="{0}"
:customize-text="(e: any) => formatNumber(parseFloat(e.value.toString()))"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxGroupItem
css-class="!text-right"
@@ -255,7 +246,7 @@
column="sla_gangguan"
summary-type="sum"
display-format="{0}"
:customize-text="(e: any) => formatNumber(parseFloat(e.value.toString()))"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxGroupItem
css-class="!text-right"
@@ -265,7 +256,7 @@
column="avg_durasi_recovery_keluhan"
summary-type="sum"
display-format="{0}"
:customize-text="(e: any) => formatNumber(parseFloat(e.value.toString()))"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxGroupItem
css-class="!text-right"
@@ -275,7 +266,7 @@
column="sla_keluhan"
summary-type="sum"
display-format="{0}"
:customize-text="(e: any) => formatNumber(parseFloat(e.value.toString()))"
:customize-text="(e: any) => formatNumber(e.value)"
/>
<DxGroupItem
css-class="!text-right"
@@ -286,10 +277,7 @@
summary-type="avg"
display-format="{0}"
:customize-text="
(e: any) =>
parseFloat(e.value.toString())
? formatPercentage(parseFloat(e.value.toString()))
: '0%'
(e: any) => (parseFloat(e.value.toString()) ? formatPercentage(e.value) : '0%')
"
/>
<DxGroupItem
@@ -301,10 +289,7 @@
summary-type="avg"
display-format="{0}"
:customize-text="
(e: any) =>
parseFloat(e.value.toString())
? formatPercentage(parseFloat(e.value.toString()))
: '0%'
(e: any) => (parseFloat(e.value.toString()) ? formatPercentage(e.value) : '0%')
"
/>
<DxGroupItem
@@ -316,10 +301,7 @@
summary-type="avg"
display-format="{0}"
:customize-text="
(e: any) =>
parseFloat(e.value.toString())
? formatPercentage(parseFloat(e.value.toString()))
: '0%'
(e: any) => (parseFloat(e.value.toString()) ? formatPercentage(e.value) : '0%')
"
/>
</DxSummary>