mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
be0b52a916
2 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue