An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Add template func `FormatFloat` https://github.com/siyuan-note/siyuan/issues/11158
Daniel032c1e2dc613
diff --git a/kernel/util/template.go b/kernel/util/template.goindex 3e5b13ba06..00e4328fec 100644--- a/kernel/util/template.go+++ b/kernel/util/template.go@@ -17,13 +17,15 @@package utilimport (+ "math"+ "text/template"+ "time"++ "github.com/88250/go-humanize""github.com/Masterminds/sprig/v3""github.com/araddon/dateparse""github.com/siyuan-note/logging""github.com/spf13/cast"- "math"- "text/template"- "time")func BuiltInTemplateFuncs() (ret template.FuncMap) {@@ -37,6 +39,7 @@ func BuiltInTemplateFuncs() (ret template.FuncMap) {ret["log"] = logret["logf"] = logfret["parseTime"] = parseTime+ ret["FormatFloat"] = FormatFloatreturn}@@ -56,3 +59,7 @@ func parseTime(dateStr string) time.Time {}return retTime}++func FormatFloat(format string, n float64) string {+ return humanize.FormatFloat(format, n)+}