rusackas commented on code in PR #40681:
URL: https://github.com/apache/superset/pull/40681#discussion_r3608986768


##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts:
##########
@@ -100,20 +100,23 @@ const processComparisonTotals = (
     return totals;
   }
   const transformedTotals: DataRecord = {};
+  const mainLabel = t('Main');
   totals.map((totalRecord: DataRecord) =>
     Object.keys(totalRecord).forEach(key => {
       if (totalRecord[key] !== undefined && !key.includes(comparisonSuffix)) {
-        transformedTotals[`Main ${key}`] =
-          parseInt(transformedTotals[`Main ${key}`]?.toString() || '0', 10) +
-          parseInt(totalRecord[key]?.toString() || '0', 10);
+        transformedTotals[`${mainLabel} ${key}`] =
+          parseInt(
+            transformedTotals[`${mainLabel} ${key}`]?.toString() || '0',
+            10,
+          ) + parseInt(totalRecord[key]?.toString() || '0', 10);

Review Comment:
   Good catch, switched the totals accumulation from `parseInt` to `parseFloat` 
so fractional metrics (averages, ratios) don't get truncated. Pushed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to