mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 Attribute View columns calculate https://github.com/siyuan-note/siyuan/issues/8699
This commit is contained in:
parent
eafdf0ab7e
commit
de68e10ec9
1 changed files with 5 additions and 1 deletions
|
|
@ -666,7 +666,11 @@ func (table *Table) calcColNumber(col *TableColumn, colIndex int) {
|
|||
count++
|
||||
}
|
||||
}
|
||||
col.Calc.Result = &Value{Number: &ValueNumber{Content: sum / float64(count)}}
|
||||
if 0 != count {
|
||||
col.Calc.Result = &Value{Number: &ValueNumber{Content: sum / float64(count)}}
|
||||
} else {
|
||||
col.Calc.Result = &Value{Number: &ValueNumber{Content: 0}}
|
||||
}
|
||||
case CalcOperatorMedian:
|
||||
values := []float64{}
|
||||
for _, row := range table.Rows {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue