From b107f65b9edb3c1c2f1bed59afec608f7f055585 Mon Sep 17 00:00:00 2001
From: Flip <philippe@pilarkto.net>
Date: Tue, 21 Mar 2017 10:21:29 +0100
Subject: [PATCH] fix zip format

---
 .../lib/gluon/config-mode/wizard/0450-geo-location.lua    | 2 +-
 gluon-config-mode-zip/src/respondd.c                      | 8 +-------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/gluon-config-mode-zip/luasrc/lib/gluon/config-mode/wizard/0450-geo-location.lua b/gluon-config-mode-zip/luasrc/lib/gluon/config-mode/wizard/0450-geo-location.lua
index b71ffd8..c2f30cd 100644
--- a/gluon-config-mode-zip/luasrc/lib/gluon/config-mode/wizard/0450-geo-location.lua
+++ b/gluon-config-mode-zip/luasrc/lib/gluon/config-mode/wizard/0450-geo-location.lua
@@ -12,7 +12,7 @@ function M.section(form)
     local o = s:option(cbi.Value, "_zip", fieldlabel)
     o.value = uci:get_first("gluon-node-info", "location", "zip")
     o.rmempty = true
-    o.datatype = "float"
+    o.datatype = "uinteger"
     o.description = i18n.translatef("e.g. %s", "70499")
 end
 
diff --git a/gluon-config-mode-zip/src/respondd.c b/gluon-config-mode-zip/src/respondd.c
index 5690e4c..7892538 100644
--- a/gluon-config-mode-zip/src/respondd.c
+++ b/gluon-config-mode-zip/src/respondd.c
@@ -51,13 +51,7 @@ static struct json_object * get_number(struct uci_context *ctx, struct uci_secti
 	if (!val || !*val)
 		return NULL;
 
-	char *end;
-	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);
+	struct json_object *jso = json_object_new_string(val);
 	return jso;
 }
 
-- 
GitLab