Module:Items/ComparisonTables: Difference between revisions

Add N/A for attack speed column where the item isn't a weapon
No edit summary
(Add N/A for attack speed column where the item isn't a weapon)
Line 298: Line 298:
if isWeapon == true then
if isWeapon == true then
local atkSpeed = getAttackSpeed(item)
local atkSpeed = getAttackSpeed(item)
row:tag('td'):wikitext(Num.round(atkSpeed / 1000, 3, 1) .. 's')
if atkSpeed > 0 then
:attr('data-sort-value', atkSpeed)
row:tag('td'):wikitext(Num.round(atkSpeed / 1000, 3, 1) .. 's')
:css('text-align', 'right')
:attr('data-sort-value', atkSpeed)
:css('text-align', 'right')
else
row:tag('td'):wikitext('N/A')
:addClass('table-na')
end
end
end
2,875

edits