Data server rounding issue

Answered
brian mulh asked on January 30, 2024

I have noticed that the floating point numbers coming from the data server that are summed will be something like 0.000000001 rather than 0. I found some tickets mentioning using "maxDecimalPlaces" to format the value which I tried. The value displayed in the pivot table is in fact rounded correctly but we have some javascript code that accesses the value and it is not rounded even with something like "maxDecimalPlaces" = 2.  An example of the code is:
```
var cell = pivot.getCell(data.rowIndex, data.rows.length);
var cellValue = cell.value;
// cellValue == 0.000000001
```
Is there another setting we need to support rounding the data coming from the data server?

6 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster January 31, 2024

Hello,

Thank you for reporting the issue.

We will research the possible solutions and provide the results with our minor release with the ETA February 19th. As a workaround, you can use the cell.label property instead of cell.value to get a 0 value.

You are welcome to contact us in case other questions arise.

Kind regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster February 20, 2024

Hello, 

We are happy to let you know that the issue with number precision was fixed for the CellDataObject.

This fix is provided in the 2.9.71 version of Flexmonster: https://www.flexmonster.com/release-notes/version-2-9-71/  

You are welcome to update the component. Here is our updating guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/ 

Please let us know if the fix works fine for you.

Best regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster February 29, 2024

Hello Brian,

Hope you are doing great!

We were wondering if you had a chance to check the updated version. Could you please confirm if it works for you? 

Looking forward to hearing your feedback.

Kind regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster March 12, 2024

Hello Brian,

Hope you are doing well.

Just checking in to ask if you had a chance to update Flexmonster to the latest version. Does the fix work for you?

Looking forward to hearing your feedback.

Kind regards,
Nadia

Public
brian mulh March 12, 2024

Nadia,
 
Sorry I missed your previous message.  I was able to upgrade to the latest version and confirm that the issue was fixed. Thank you for the fast response!
 
Brian

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster March 13, 2024

Hi Brian,

Thank you for the feedback.

We are glad to hear that the fix works for you!

As always, feel free to contact us if other questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer