Skip to content
Snippets Groups Projects
Commit b107f65b authored by Philippe's avatar Philippe
Browse files

fix zip format

parent f00e339e
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ function M.section(form) ...@@ -12,7 +12,7 @@ function M.section(form)
local o = s:option(cbi.Value, "_zip", fieldlabel) local o = s:option(cbi.Value, "_zip", fieldlabel)
o.value = uci:get_first("gluon-node-info", "location", "zip") o.value = uci:get_first("gluon-node-info", "location", "zip")
o.rmempty = true o.rmempty = true
o.datatype = "float" o.datatype = "uinteger"
o.description = i18n.translatef("e.g. %s", "70499") o.description = i18n.translatef("e.g. %s", "70499")
end end
......
...@@ -51,13 +51,7 @@ static struct json_object * get_number(struct uci_context *ctx, struct uci_secti ...@@ -51,13 +51,7 @@ static struct json_object * get_number(struct uci_context *ctx, struct uci_secti
if (!val || !*val) if (!val || !*val)
return NULL; return NULL;
char *end; struct json_object *jso = json_object_new_string(val);
double d = strtod(val, &end);
if (*end)
return NULL;
struct json_object *jso = json_object_new_double(d);
json_object_set_serializer(jso, json_object_double_to_json_string, "%.8f", NULL);
return jso; return jso;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment