ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: hyh888 on June 16, 2023, 07:10:45 pm
-
When I change the pivot demo's foumula to make it do division( line 89------- var total = rd.gold /rd.silver; ), I found the "sum(total)" column's value change to "infinity".
Is there any solution for it?
-
isFinite() check can be used:
formulas: [['total', function(rd){
var total = rd.gold /rd.silver;
return isNaN(total) || !isFinite(total)? "": total;
}]],
-
Dear Paramvir,
Thank you very much for your reply, but when I tried your solution in your demo, almost all results are wrong(even not "infinit").
In the following pic, in the 1st line, the result should be between 2 and 3, but it becomes 8.
-
Dear Paramvir,
Should this issue be treated as a bug?
-
This is answered here: https://paramquery.com/forum/index.php?topic=4648.0