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 96b213c386
commit a2f699cafd

View File

@ -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"