mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🐛 Negative numbers are treated as positive numbers when calculating template field values https://github.com/siyuan-note/siyuan/issues/11446
This commit is contained in:
parent
0ad0d416c4
commit
b670cdb29a
1 changed files with 1 additions and 1 deletions
|
|
@ -124,7 +124,7 @@ func Convert2Float(s string) (float64, bool) {
|
||||||
s = strings.ReplaceAll(s, ",", "")
|
s = strings.ReplaceAll(s, ",", "")
|
||||||
buf := bytes.Buffer{}
|
buf := bytes.Buffer{}
|
||||||
for _, r := range s {
|
for _, r := range s {
|
||||||
if unicode.IsDigit(r) || '.' == r {
|
if unicode.IsDigit(r) || '.' == r || '-' == r {
|
||||||
buf.WriteRune(r)
|
buf.WriteRune(r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue