KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Datatable calculating wrong footer sum when there is a formating in the column involved #1978

Open ankit raj opened this topic on on Mar 18, 2021 - 2 comments

ankit raj commented on Mar 18, 2021

Hi , I am using datatables of datagrid package and I force the number to be .0 if its a whole number. But my footer sum is coming wrong as you can see in this picture:

i have forced comma seperated before also but that is working fine. i tried using footertext property but even that makes it 5.0 , what else can i try?

"col_name"=>['label'=>'aaaa',"footerText"=>$sum_array['test_col'],'formatValue'=>function($value,$row){return $this->formatter($value);}]

"col_name"=>['label'=>'aaaa',"footer"=>'sum','formatValue'=>function($value,$row){return $this->numberToCurrency($value);}]

I tried both ways but when value crosses 1000 , it makes it first digit and .0 . I tested the value returned by my formatter but even that is correct.

what else can i try?

ankit raj commented on Mar 19, 2021

Also it goes wrong only when the number crosses more than a thousand. please let me know what changes needs to be done. @koolreport team

Sebastian Morales commented on Mar 19, 2021

What happens if you don't use "formatValue"? Is the footer value correctly displayed in that case?

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

DataGrid