Skip to content

Commit

Permalink
fix: avoid undefined in totals DHIS2-14511
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Aug 15, 2023
1 parent 3b7302d commit 2249e73
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/modules/pivotTable/PivotTableEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ export class PivotTableEngine {
dataFields.forEach((field) => {
const headerIndex = this.dimensionLookup.dataHeaders[field]
const value = parseValue(dataRow[headerIndex])
if (value && !isNaN(value)) {
if (!isNaN(value)) {
totalCell[field] = (totalCell[field] || 0) + value
}
})
Expand All @@ -724,7 +724,7 @@ export class PivotTableEngine {
dataFields.forEach((field) => {
const headerIndex = this.dimensionLookup.dataHeaders[field]
const value = parseValue(dataRow[headerIndex])
if (value && !isNaN(value)) {
if (!isNaN(value)) {
percentageTotal[field] =
(percentageTotal[field] || 0) + value
}
Expand All @@ -742,7 +742,7 @@ export class PivotTableEngine {
dataFields.forEach((field) => {
const headerIndex = this.dimensionLookup.dataHeaders[field]
const value = parseValue(dataRow[headerIndex])
if (value && !isNaN(value)) {
if (!isNaN(value)) {
percentageTotal[field] =
(percentageTotal[field] || 0) + value
}
Expand All @@ -761,7 +761,7 @@ export class PivotTableEngine {
dataFields.forEach((field) => {
const headerIndex = this.dimensionLookup.dataHeaders[field]
const value = parseValue(dataRow[headerIndex])
if (value && !isNaN(value)) {
if (!isNaN(value)) {
percentageTotal[field] =
(percentageTotal[field] || 0) + value
}
Expand All @@ -780,7 +780,7 @@ export class PivotTableEngine {
dataFields.forEach((field) => {
const headerIndex = this.dimensionLookup.dataHeaders[field]
const value = parseValue(dataRow[headerIndex])
if (value && !isNaN(value)) {
if (!isNaN(value)) {
percentageTotal[field] =
(percentageTotal[field] || 0) + value
}
Expand All @@ -798,7 +798,7 @@ export class PivotTableEngine {
dataFields.forEach((field) => {
const headerIndex = this.dimensionLookup.dataHeaders[field]
const value = parseValue(dataRow[headerIndex])
if (value && !isNaN(value)) {
if (!isNaN(value)) {
percentageTotal[field] =
(percentageTotal[field] || 0) + value
}
Expand All @@ -817,7 +817,7 @@ export class PivotTableEngine {
dataFields.forEach((field) => {
const headerIndex = this.dimensionLookup.dataHeaders[field]
const value = parseValue(dataRow[headerIndex])
if (value && !isNaN(value)) {
if (!isNaN(value)) {
percentageTotal[field] =
(percentageTotal[field] || 0) + value
}
Expand Down

0 comments on commit 2249e73

Please sign in to comment.