Module:Infobox ET: Difference between revisions

Apparently highly composite and zeta should be sorted too
"is_zeta" -> "zeta_switch", make it overridable by zeta_override. Also don't show zeta when not sure
Line 69: Line 69:
-- zeta test
-- zeta test
local zeta_override = frame.args['Zeta']
local zeta_override = frame.args['Zeta']
local is_zeta = nil
local zeta_switch = nil
if type(zeta_override) == 'string' and #zeta_override > 0 then
if type(zeta_override) == 'string' and #zeta_override > 0 then
is_zeta = not zeta_override:match('^[Nn][Oo]$')
zeta_switch = not zeta_override:match('^[Nn][Oo]$')
end
else
if not rat.eq(et.equave, 2) then
zeta_switch = rat.eq(et.equave, 2) and ET.is_zeta(et)
is_zeta = false
end
end
Line 106: Line 105:
u._prime_factorization(et.size) .. prime
u._prime_factorization(et.size) .. prime
})
})
if ET.is_highly_composite(et) or (is_zeta ~= false and ET.is_zeta(et)) then
 
-- special properties
if ET.is_highly_composite(et) or zeta_switch then
local text = ''
local text = ''
if ET.is_highly_composite(et) then
if ET.is_highly_composite(et) then
Line 114: Line 115:
end
end
end
end
if is_zeta ~= false and ET.is_zeta(et) then
if zeta_switch then
if #text > 0 then text = text .. '<br>' end
if #text > 0 then text = text .. '<br>' end
if type(zeta_override) ~= 'string' or #zeta_override == 0 then
if not (type(zeta_override) == 'string' and #zeta_override > 0) then
text = text .. ET.why_zeta(et)
text = text .. ET.why_zeta(et)
else
else