Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Negative numbers are treated as positive numbers when calculating template field values https://github.com/siyuan-note/siyuan/issues/11446

Danielb670cdb29af7
diff --git a/kernel/util/misc.go b/kernel/util/misc.go
index c319083bfa..97c7581260 100644
--- a/kernel/util/misc.go
+++ b/kernel/util/misc.go
@@ -124,7 +124,7 @@ func Convert2Float(s string) (float64, bool) {
s = strings.ReplaceAll(s, ",", "")
buf := bytes.Buffer{}
for _, r := range s {
- if unicode.IsDigit(r) || '.' == r {
+ if unicode.IsDigit(r) || '.' == r || '-' == r {
buf.WriteRune(r)
}
}