Skip to content
Snippets Groups Projects
Commit a2f699ca authored by Nils Schneider's avatar Nils Schneider
Browse files

gluon-config-mode: avoid string.format("%f", ...

An undocumented feature of uci:get_first() is to cast the returned value
to the same type as the default argument. Thus, supplying a default
value ot type number makes string.format superfluous.
parent 96b213c3
No related branches found
No related tags found
No related merge requests found
...@@ -57,13 +57,13 @@ o.default = uci:get_first("gluon-node-info", "location", "share_location", o.dis ...@@ -57,13 +57,13 @@ o.default = uci:get_first("gluon-node-info", "location", "share_location", o.dis
o.rmempty = false o.rmempty = false
o = s:option(Value, "_latitude", "Breitengrad") o = s:option(Value, "_latitude", "Breitengrad")
o.default = string.format("%f", uci:get_first("gluon-node-info", "location", "latitude", "0")) o.default = uci:get_first("gluon-node-info", "location", "latitude", 0)
o.rmempty = false o.rmempty = false
o.datatype = "float" o.datatype = "float"
o.description = "z.B. 53.873621" o.description = "z.B. 53.873621"
o = s:option(Value, "_longitude", "Längengrad") o = s:option(Value, "_longitude", "Längengrad")
o.default = string.format("%f", uci:get_first("gluon-node-info", "location", "longitude", "0")) o.default = uci:get_first("gluon-node-info", "location", "longitude", 0)
o.rmempty = false o.rmempty = false
o.datatype = "float" o.datatype = "float"
o.description = "z.B. 10.689901" o.description = "z.B. 10.689901"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment