KoolReport's Forum

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

Making an int out of a float #2187

Open Richb201 opened this topic on on Jul 7, 2021 - 1 comments

Richb201 commented on Jul 7, 2021

I am calculating the % POE by array(

            "label"=>"% a POE",
            "type"=>"integer",
            "value"=>function($row) {
                if (($row["research_dol"]+$row["support_dol"]+$row["supervision_dol"])==0)
                     return 0;
                else
                    return($row["research_dol"]*100/($row["research_dol"]+$row["support_dol"]+$row["supervision_dol"]));
            },

What kind of type will get just a whole number?

Sebastian Morales commented on Jul 8, 2021

Pls use either round() (rounding to the nearest int), floor(), or ceil() function to achieve your result. Tks,

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
solved

None