Editing Module:Abilities/utilsGive feedback
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 19: | Line 19: | ||
end | end | ||
return nil | return nil | ||
end | end | ||
-- Add prefix and postfix labels to a value. Eg. "32" -> "32s" | -- Add prefix and postfix labels to a value. Eg. "32" -> "32s" | ||
function p.format_value_with_prepost(key, value, frame, exclude_plus) | function p.format_value_with_prepost(key, value, frame, exclude_plus) | ||
if (value == nil) then return nil end | if (value == nil) then return nil end | ||
| Line 77: | Line 50: | ||
prefix = '+' | prefix = '+' | ||
end | end | ||
-- ONLY add a '+' if the value is positive AND there isn't already a prefix. | |||
elseif (type(value) == 'number' and value > 0 and prefix == '') then | |||
-- | prefix = '+' | ||
prefix = '' | |||
end | end | ||
| Line 94: | Line 65: | ||
prefix..value, | prefix..value, | ||
postfix, | postfix, | ||
uom_style = 'font-size: | uom_style = 'font-size: 12px;' | ||
} | } | ||
} | } | ||