FANDOM


local Infobox = {}
local HF = require('Module:HF')
local FormatNum = require('Module:FormatNum')
local lang = mw.language.new('en')
 
-- replaces {{#if:{{{topspeed|}}}|{{{topspeed|?}}} m/s|---}} logic
function Infobox.Quantify( field, vars )
    local unit = field.Unit or ''
    local value = field.Value or field.Default or '?'
    if HF.isempty(value) then 
        return '---'
    else
        return value .. ' ' .. unit
    end
end
 
-- fixes numbers with commas, e.g: 4,323
function Infobox.FormatCost( field, vars )
    if HF.isempty(field.Value) then
        return '---'
    else
        field.Value = FormatNum.commavalue(field.Value:gsub(',',''))
        return Infobox.Quantify(field, vars)
    end
end
 
return Infobox

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.