Skip to content

Implement average for table totals #973

@PhilippGrashoff

Description

@PhilippGrashoff

Currently, there is no "avg" for table totals. Implementation would be easy, I can take care of it when I update to current versions. Code is quite finished:

  1. new property avgCount for table: $this->avgCount = 0;
  2. that code in updateTotals:
case 'avg':
    if($this->model[$key] !== null) { //only use non null values for sensible average calculation
        $this->totals[$key] = (($this->totals[$key] * $this->avgCount) + $this->model[$key]) / ($this->avgCount + 1);
        $this->avgCount++;
    }
    break;

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions