From 58f8a2ce844da1aca1a12cbf734ff203f99c4b61 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Thu, 22 Sep 2022 17:23:21 +0200 Subject: [PATCH] Non riassegnava il valore float dopo pulitura. --- form.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/form.go b/form.go index de746a8..a0ed3f5 100644 --- a/form.go +++ b/form.go @@ -194,10 +194,6 @@ func CreaMapValidator(elems map[string]*FormElement, r *http.Request) (map[strin valori := make(map[string]interface{}) regole := make(map[string]interface{}) for _, elem := range elems { - /*if elem.Name == "IDAssociazioni" { - i, _ := strconv.Atoi(r.FormValue(elem.Name)) - valori[elem.Name] = i - } else {*/ if elem.Filter != "" { splitted := strings.Split(elem.Filter, ",") for _, f := range splitted { @@ -234,6 +230,8 @@ func CreaMapDb (elems map[string]*FormElement) (map[string]interface{}) { v, _ := strconv.ParseFloat(str, 64) if elem.DBType == "int" || strings.Contains(elem.Validation, "numeric_it=int") { campi[elem.DBName] = int(v) + } else { + campi[elem.DBName] = v } } else if strings.Contains(elem.Validation, "mydate") { /* metto la data in formato sql */ -- 2.49.0