add negation to isFinite

This commit is contained in:
Dede Fuji Abdul
2024-04-16 22:22:36 +07:00
parent 98eec9f138
commit 018032afda
20 changed files with 102 additions and 131 deletions

View File

@ -923,7 +923,7 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_selesai = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(total_selesai / total)
options.totalValue = !isFinite(total_selesai / total)
? 0
: total_selesai == 0
? 0
@ -936,7 +936,7 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_inproses = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(total_inproses / total)
options.totalValue = !isFinite(total_inproses / total)
? 0
: total_inproses == 0
? 0
@ -965,7 +965,7 @@ const calculateCustomSummary = (options: any) => {
total_durasi_response = 0
count_durasi_response = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
options.totalValue = !isFinite(count_durasi_response / total_durasi_response)
? 0
: count_durasi_response == 0
? 0
@ -994,7 +994,7 @@ const calculateCustomSummary = (options: any) => {
count_durasi_recovery = 0
total_durasi_recovery = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
options.totalValue = !isFinite(count_durasi_recovery / total_durasi_recovery)
? 0
: count_durasi_recovery == 0
? 0

View File

@ -1097,7 +1097,8 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_selesai = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = total == 0 ? 0 : (total_selesai / total) * 100
options.totalValue =
!isFinite(total_selesai / total) || total_selesai == 0 ? 0 : (total_selesai / total) * 100
}
}
@ -1106,7 +1107,10 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_inproses = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = total == 0 ? 0 : (total_inproses / total) * 100
options.totalValue =
!isFinite(total_inproses / total) || total_inproses == 0
? 0
: (total_inproses / total) * 100
}
}
@ -1131,7 +1135,10 @@ const calculateCustomSummary = (options: any) => {
total_durasi_response = 0
count_durasi_response = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = count_durasi_response / total_durasi_response
options.totalValue =
!isFinite(count_durasi_response / total_durasi_response) || count_durasi_response == 0
? 0
: count_durasi_response / total_durasi_response
}
}
@ -1156,7 +1163,10 @@ const calculateCustomSummary = (options: any) => {
count_durasi_recovery = 0
total_durasi_recovery = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = count_durasi_recovery / total_durasi_recovery
options.totalValue =
!isFinite(count_durasi_recovery / total_durasi_recovery) || count_durasi_recovery == 0
? 0
: count_durasi_recovery / total_durasi_recovery
}
}
}

View File

@ -1063,7 +1063,7 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_selesai = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(total_selesai / total)
options.totalValue = !isFinite(total_selesai / total)
? 0
: total_selesai == 0
? 0
@ -1076,7 +1076,7 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_inproses = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(total_inproses / total)
options.totalValue = !isFinite(total_inproses / total)
? 0
: total_inproses == 0
? 0
@ -1105,7 +1105,7 @@ const calculateCustomSummary = (options: any) => {
total_durasi_response = 0
count_durasi_response = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
options.totalValue = !isFinite(count_durasi_response / total_durasi_response)
? 0
: count_durasi_response == 0
? 0
@ -1134,7 +1134,7 @@ const calculateCustomSummary = (options: any) => {
count_durasi_recovery = 0
total_durasi_recovery = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
options.totalValue = !isFinite(count_durasi_recovery / total_durasi_recovery)
? 0
: count_durasi_recovery == 0
? 0

View File

@ -907,7 +907,7 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_selesai = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(total_selesai / total)
options.totalValue = !isFinite(total_selesai / total)
? 0
: total_selesai == 0
? 0
@ -920,7 +920,7 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_inproses = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(total_inproses / total)
options.totalValue = !isFinite(total_inproses / total)
? 0
: total_inproses == 0
? 0
@ -949,7 +949,7 @@ const calculateCustomSummary = (options: any) => {
total_durasi_response = 0
count_durasi_response = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
options.totalValue = !isFinite(count_durasi_response / total_durasi_response)
? 0
: count_durasi_response == 0
? 0
@ -978,7 +978,7 @@ const calculateCustomSummary = (options: any) => {
count_durasi_recovery = 0
total_durasi_recovery = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
options.totalValue = !isFinite(count_durasi_recovery / total_durasi_recovery)
? 0
: count_durasi_recovery == 0
? 0

View File

@ -912,7 +912,7 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_selesai = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(total_selesai / total)
options.totalValue = !isFinite(total_selesai / total)
? 0
: total_selesai == 0
? 0
@ -925,7 +925,7 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_inproses = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(total_inproses / total)
options.totalValue = !isFinite(total_inproses / total)
? 0
: total_inproses == 0
? 0
@ -954,7 +954,7 @@ const calculateCustomSummary = (options: any) => {
total_durasi_response = 0
count_durasi_response = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
options.totalValue = !isFinite(count_durasi_response / total_durasi_response)
? 0
: count_durasi_response == 0
? 0
@ -983,7 +983,7 @@ const calculateCustomSummary = (options: any) => {
count_durasi_recovery = 0
total_durasi_recovery = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
options.totalValue = !isFinite(count_durasi_recovery / total_durasi_recovery)
? 0
: count_durasi_recovery == 0
? 0

View File

@ -1055,7 +1055,7 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_selesai = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(total_selesai / total)
options.totalValue = !isFinite(total_selesai / total)
? 0
: total_selesai == 0
? 0
@ -1068,7 +1068,7 @@ const calculateCustomSummary = (options: any) => {
total = 0
total_inproses = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(total_inproses / total)
options.totalValue = !isFinite(total_inproses / total)
? 0
: total_inproses == 0
? 0
@ -1097,7 +1097,7 @@ const calculateCustomSummary = (options: any) => {
total_durasi_response = 0
count_durasi_response = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
options.totalValue = !isFinite(count_durasi_response / total_durasi_response)
? 0
: count_durasi_response == 0
? 0
@ -1126,7 +1126,7 @@ const calculateCustomSummary = (options: any) => {
count_durasi_recovery = 0
total_durasi_recovery = 0
} else if (options.summaryProcess === 'finalize') {
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
options.totalValue = !isFinite(count_durasi_recovery / total_durasi_recovery)
? 0
: count_durasi_recovery == 0
? 0