Need a special offer?Find out if your project fits.
+

Tooltip Sum Discrepancy Due to Rounding in Flexmonster

Answered
Naveen Kumar asked on August 21, 2024

I need assistance with a specific issue in Flexmonster. When selecting two or more cells in a row or a column, the tooltip at the bottom displays the sum, average, and other calculations. However, I’m encountering a problem where numbers are being rounded off to the nearest integer (e.g., 5.3 is rounded to 5). Additionally, when summing multiple rows, the UI only displays the exact sum, but if I set it to 0 decimal places as i dont want any decimal places to show in the UI (e.g., 7.6 + 9.6 + 9.1), the values are displayed as 8, 10, and 9 in the UI. Consequently, the sum as per the UI should be 27, but the tooltip incorrectly shows the sum as 26, which doesn’t align with the rounded values displayed.

Is there a way to resolve this issue?

1 answer

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster August 23, 2024

Hello Naveen,

Thank you for reaching out to us.

Kindly note that this is the expected behavior of Flexmonster. Since 7.6 + 9.6 + 9.1 = 26.3, even when rounded to 0 decimal places, the sum on the tooltip will still be 26. In other words, Flexmonster rounds values separately, it does not count the sum of the rounded values. It rounds 7.6 to 8, 9.6 to 10, 9.1 to 9, and 26.3 to 26.

Alternatively, you can disable the tooltip by setting the grid.showAutoCalculationBar property of the Options object to false. Please check the following JSFiddle for reference: https://jsfiddle.net/flexmonster/ypzuwagk/

We hope that our response has addressed your question. Feel free to contact us if other questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer