🎨 Improve database table view template col sorting https://ld246.com/article/1702871433047
This commit is contained in:
parent
28c7f6df7f
commit
305f781afa
1 changed files with 5 additions and 3 deletions
|
@ -176,9 +176,11 @@ func (value *Value) Compare(other *Value) int {
|
|||
}
|
||||
case KeyTypeTemplate:
|
||||
if nil != value.Template && nil != other.Template {
|
||||
if util.IsNumeric(value.Template.Content) && util.IsNumeric(other.Template.Content) {
|
||||
v1, _ := strconv.ParseFloat(value.Template.Content, 64)
|
||||
v2, _ := strconv.ParseFloat(other.Template.Content, 64)
|
||||
vContent := strings.TrimSpace(value.Template.Content)
|
||||
oContent := strings.TrimSpace(other.Template.Content)
|
||||
if util.IsNumeric(vContent) && util.IsNumeric(oContent) {
|
||||
v1, _ := strconv.ParseFloat(vContent, 64)
|
||||
v2, _ := strconv.ParseFloat(oContent, 64)
|
||||
if v1 > v2 {
|
||||
return 1
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue