Module:Sandbox/LVL: Difference between revisions

LVL (talk | contribs)
No edit summary
LVL (talk | contribs)
No edit summary
Line 255: Line 255:
local scaling_abbrevs = {Spirit = "Ss", Level = "PI"}
local scaling_abbrevs = {Spirit = "Ss", Level = "PI"}
-- Return blank if it doesnt scale
if (scaling_value == 0) then return "" end
if (scaling_value == 0) then return "" end
-- Round it
scaling_value = util_module.round_to_sig_fig(scaling_value, 3)
scaling_value = util_module.round_to_sig_fig(scaling_value, 3)
--The hero has a scaling value with this stat
local template_title = "Template:" .. scaling_abbrevs[scaling_type]
local template_title = "Template:" .. scaling_abbrevs[scaling_type] --scaling type's abbreviation
local template_args = {}
local template_args = {}
template_args["1"] = scaling_value --store in 1st arg for {{{1}}} to grab it from {{SS}} or {{LS}} template
template_args["1"] = scaling_value
local template_call = mw.getCurrentFrame():expandTemplate{ title = template_title, args = template_args }
local template_call = mw.getCurrentFrame():expandTemplate{ title = template_title, args = template_args }
return template_call
   
-- STRIP NEWLINES to prevent alignment breaking in tables
return template_call:gsub("\n", ""):gsub("\r", "")
end
end