mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -147,7 +147,8 @@ func NewFormattedValueNumber(content float64, format NumberFormat) (ret *ValueNu
|
||||
}
|
||||
switch format {
|
||||
case NumberFormatNone:
|
||||
ret.FormattedContent = strconv.FormatFloat(content, 'f', -1, 64)
|
||||
s := fmt.Sprintf("%.5f", content)
|
||||
ret.FormattedContent = strings.TrimRight(strings.TrimRight(s, "0"), ".")
|
||||
case NumberFormatPercent:
|
||||
s := fmt.Sprintf("%.2f", content*100)
|
||||
ret.FormattedContent = strings.TrimRight(strings.TrimRight(s, "0"), ".") + "%"
|
||||
|
||||
@@ -674,7 +674,7 @@ func (table *Table) calcColNumber(col *TableColumn, colIndex int) {
|
||||
sum += row.Cells[colIndex].Value.Number.Content
|
||||
}
|
||||
}
|
||||
col.Calc.Result = &Value{Number: NewFormattedValueNumber(float64(sum), NumberFormatNone)}
|
||||
col.Calc.Result = &Value{Number: NewFormattedValueNumber(sum, NumberFormatNone)}
|
||||
case CalcOperatorAverage:
|
||||
sum := 0.0
|
||||
count := 0
|
||||
|
||||
Reference in New Issue
Block a user