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.
This commit is contained in:
Nils Schneider 2014-03-02 14:05:14 +01:00
parent 3811912a45
commit 06076b2b4f
1 changed files with 2 additions and 2 deletions

View File

@ -57,13 +57,13 @@ o.default = uci:get_first("gluon-node-info", "location", "share_location", o.dis
o.rmempty = false
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.datatype = "float"
o.description = "z.B. 53.873621"
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.datatype = "float"
o.description = "z.B. 10.689901"