Module:Infobox regtemp: Difference between revisions

Fix
+ a constant (12) above which we stop converting numbers to greek
Line 24: Line 24:
local mos = frame.args["mosses"]
local mos = frame.args["mosses"]
local ploidacot = frame.args["ploidacot"]
local ploidacot_override = frame.args["ploidacot"]
local colorname = frame.args["colorname"]
local colorname = frame.args["colorname"]
local pergen = frame.args["pergen"]
local pergen = frame.args["pergen"]
Line 128: Line 128:
end
end
suffix = p.num2greeklet(tostring(shear)) .. p.num2greek(tostring(cot), "cot") .. suffix
-- construct the ploidacot signature
local MAX_GREEK_NUMERAL = 12 -- max number to convert to greek letters/numerals
if ploid ~= 1 then
local ploid_sig
suffix = p.num2greek(tostring(ploid), "ploid") .. "ploid " .. suffix
if ploid == 1 then
ploid_sig = "" -- omit the ploid part
elseif ploid <= MAX_GREEK_NUMERAL then
ploid_sig = p.num2greek(tostring(ploid), "ploid") .. "ploid "
else
ploid_sig = tostring (ploid) .. "-ploid "
end
local shear_sig
if shear <= MAX_GREEK_NUMERAL then
shear_sig = p.num2greeklet(tostring(shear))
else
shear_sig = tostring(shear) .. "-sheared "
end
local cot_sig
if cot <= MAX_GREEK_NUMERAL then
cot_sig = p.num2greek(tostring(cot), "cot") .. suffix
else
cot_sig = tostring(cot) .. "-" .. suffix
end
end
if not u.value_provided (ploidacot) then
ploidacot = ploid_sig .. shear_sig .. cot_sig
ploidacot = suffix
-- user override
if u.value_provided (ploidacot_override) then
ploidacot = ploidacot_override
end
end