ai_helper.put_labels: display content of strings rather than 'nan'
This commit is contained in:
parent
3115b139b7
commit
623036af16
1 changed files with 6 additions and 1 deletions
|
@ -82,8 +82,13 @@ function ai_helper.put_labels(map, cfg)
|
|||
if cfg.keys then
|
||||
for i,k in ipairs(cfg.keys) do data = data[k] end
|
||||
end
|
||||
out = tonumber(data) or 'nan'
|
||||
if (type(data) == 'string') then
|
||||
out = data
|
||||
else
|
||||
out = tonumber(data) or 'nan'
|
||||
end
|
||||
end
|
||||
|
||||
if (type(out) == 'number') then out = out * factor end
|
||||
W.label { x = x, y = y, text = out }
|
||||
end)
|
||||
|
|
Loading…
Add table
Reference in a new issue