mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve database template field calc https://github.com/siyuan-note/siyuan/issues/11011
This commit is contained in:
parent
86f92208bf
commit
47aa891f34
3 changed files with 31 additions and 28 deletions
|
|
@ -24,6 +24,7 @@ import (
|
|||
"time"
|
||||
"unicode"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/html"
|
||||
)
|
||||
|
||||
|
|
@ -117,9 +118,13 @@ func RemoveRedundantSpace(str string) string {
|
|||
return buf.String()
|
||||
}
|
||||
|
||||
func IsNumeric(s string) bool {
|
||||
_, err := strconv.ParseFloat(s, 64)
|
||||
return err == nil
|
||||
func Convert2Float(s string) (float64, bool) {
|
||||
s = gulu.Str.RemoveInvisible(s)
|
||||
ret, err := strconv.ParseFloat(strings.TrimSpace(s), 64)
|
||||
if nil != err {
|
||||
return 0, false
|
||||
}
|
||||
return ret, true
|
||||
}
|
||||
|
||||
func ContainsSubStr(s string, subStrs []string) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue