🍉 Meet Flexmonster Pivot Table & Charts 2.9.Check out all hot features!
Get Free Trial

Rounding issue

Ilaria asked on November 21, 2019

I’ve a rounding issue when some records in the json dataSource have sum 0 (es +100, -100): the aggreagate value looks like ‘3.183231e-12’ intead of 0.
I found in the forum a similar issue Rounding issue and data parsing‘ that you solved in 2.7.18 but, apparenlty the fix didn’t solve mine:
Here’s a JSFiddle.
I know that I’ve to possible workaround:
– define a formatting rule to fix the decimal places.
– override the cell content in the CustomizeCell events.
The first solution is not feasible (I should force every client to define the formatting rule).
May be I could use the second solution but I think it would be cleaner if you fix the issue your side.
Thank you!

5 answers

Vera Didenko Vera Didenko Flexmonster November 22, 2019

Hello, Ilaria,
Thank you for providing a JSFiddle example for illustration.
We agree that it would be cleaner if the issue is fixed on our side.
Our team needs some time for research and we will notify you about the results with the ETA 17th of December.
Please let us know if you have any questions.
Best Regards,

Ilaria November 22, 2019

Thank you!

Illia Yatsyshyn Illia Yatsyshyn Flexmonster December 17, 2019

Hello, Ilaria,
We are pleased to inform you that the issue with representing numbers with wrong mantissa was fixed.
This is available in the 2.7.21 version of Flexmonster: https://www.flexmonster.com/release-notes/
You are welcome to update the component.
Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/ 
Please contact us in case any questions arise.
Best regards,

Ilaria January 23, 2020

I noticed that the mantissa issue is not completely solved.
I updated the previous JSFiddle, in which I changed only the numbers (value 0.1 is now set to 300.3 and value 0.6 is now set to 400.4). As you can see the issue is still there.
Thank you!

Illia Yatsyshyn Illia Yatsyshyn Flexmonster January 24, 2020

Hello, Ilaria,
Thank you for your feedback.
We would like to kindly explain that further fixes are not possible due to the specific of the JavaScript and machine computing in general. For now, our team does not see any good solution for such situations. Detailed information about the described problem and its reasons can be found by the following link: https://0.30000000000000004.com/.
We suggest using maxDecimalPlaces property of the format object in order to round off incorrectly calculated totals. Please check out an example we have prepared for you.
More information about the format object and its properties can be found following the link: Format Object.
We hope it works for you.
Kind regards,

Please login or Register to Submit Answer