/* tolgo la formattazione */
str := strings.ReplaceAll(elem.Value, ".", "")
str = strings.ReplaceAll(str, ",", ".")
- if elem.DBType == "float" || strings.Contains(elem.Validation, "numeric_it=float") {
- v, _ := strconv.ParseFloat(str, 64)
- campi[elem.DBName] = v
- } else {
- v, _ := strconv.ParseInt(str, 10, 0)
- campi[elem.DBName] = v
+ v, _ := strconv.ParseFloat(str, 64)
+ if elem.DBType == "int" || strings.Contains(elem.Validation, "numeric_it=int") {
+ campi[elem.DBName] = int(v)
}
} else if strings.Contains(elem.Validation, "mydate") {
/* metto la data in formato sql */