KoolReport's Forum

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

Displaying blank fields for zero numeric values #399

Open ingmar roos opened this topic on on Jul 30, 2018 - 1 comments

ingmar roos commented on Jul 30, 2018

Is there a way to define column behavior in the way that if the numeric value is equal to zero then blank instead of '0.0' is displayed?

Thank you in advance

KoolReport commented on Jul 30, 2018

You can use the "formatValue" to do so in Table widget:

Table::create(array(
    ...
    "columns"=>array(
        ...
        "numberColumn"=>array(
            "formatValue"=>function($value)
            {
                if($value==0)
                    return "";
                else
                    return number_format($value,1); 
            }
        )
    )
))

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
None yet

None