mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 Attribute View columns calculate https://github.com/siyuan-note/siyuan/issues/8699
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user