-- row:tag('td'):wikitext(item.speed):done()
-- end
if item.speed == nil or (tonumber(item.speed) and tonumber(item.speed) < 0) then
row:tag('td'):addClass('table-na nohighlight'):css('text-align', 'center'):wikitext('<small>N/A</small>')
elseif tonumber(item.speed) then
row:tag('td'):wikitext(item.speed):done() ▼
-- `item.speed` is a valid number or can be converted to one.
▲ row:tag('td'):wikitext(item.speed):done()
-- `item.speed` is not a valid number and cannot be converted.
row:tag('td'):wikitext('Not number (' .. tostring(item.speed) .. ')'):done()
end
-- if item.speed == nil or (tonumber(item.speed) and tonumber(item.speed) < 0) then
-- row:tag('td'):addClass('table-na nohighlight'):css('text-align', 'center'):wikitext('<small>N/A</small>')
-- else
-- if type(item.speed) ~= "number" and tonumber(item.speed) == nil then
-- row:tag('td'):wikitext('Not number'):done()
-- else
-- row:tag('td'):wikitext(item.speed):done()
-- end
-- if item.speed == nil or (tonumber(item.speed) and tonumber(item.speed) < 0) then
-- -- proceed with your existing code
-- row:tag('td'):addClass('table-na nohighlight'):css('text-align', 'center'):wikitext('<small>N/A</small>')
-- else
-- if not tonumber(item.speed) then
-- row:tag('td'):wikitext('Not number'):done()
-- else
-- row:tag('td'):wikitext(item.speed):done()
-- end
-- end
end
|