ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: bruno.anjos on October 09, 2018, 04:26:03 pm

Title: [Possible bug] Excel formula sum doesn't work as expected (V 4.0.1)
Post by: bruno.anjos on October 09, 2018, 04:26:03 pm
Hello.

I'm using the sum excel formula for my summary row like this:

summaryData: [{ classe_comp:'Soma', summaryRow: true, pq_fn:{n_nao_determinados:'sum(C:C)', n_machos:'sum(D:D)', n_femeas:'sum(E:E)', n_indiferenciados:'sum(F:F)', peso_nao_determinados:'sum(G:G)', peso_machos:'sum(H:H)', peso_femeas:'sum(I:I)', peso_indiferenciados:'sum(J:J)',  }}],

However I've noticed that when I input certain numbers in the grid the sum goes crazy and instead gives me an approximate number (either above or below). I'll attached a printscreen showing the issue.
Title: Re: [Possible bug] Excel formula sum doesn't work as expected (V 4.0.1)
Post by: paramvir on October 09, 2018, 10:05:44 pm
That's an issue with the javascript calculations.

https://stackoverflow.com/questions/1458633/how-to-deal-with-floating-point-number-precision-in-javascript

To fix it, you can use column.format to round off the decimals.