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

@@ -178,28 +178,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"
@@ -207,10 +207,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
@@ -219,10 +216,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
@@ -231,10 +225,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%')
"
/>
@@ -246,7 +237,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"
@@ -256,7 +247,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"
@@ -266,7 +257,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"
@@ -276,7 +267,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"
@@ -287,10 +278,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
@@ -302,10 +290,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
@@ -317,10 +302,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>