Module:Infobox interval: Difference between revisions

Lériendil (talk | contribs)
m moved S-expression link
Make harmonic entropy display opt-in
Line 278: Line 278:
end
end


if regular then
local harmonic_entropy = frame.args["Harmonic entropy"]
table.insert(infobox_data, {
if regular and value_provided(harmonic_entropy) then
"[[Harmonic entropy]]<br>(Shannon, <math>\\sqrt{nd}</math>)",
harmonic_entropy_switch = harmonic_entropy:match("^[Yy][Ee][Ss]$")
"~" .. utils._round(he.harmonic_entropy(cents), 6) .. " bits",
if harmonic_entropy_switch then
})
table.insert(infobox_data, {
"[[Harmonic entropy]]<br>(Shannon, <math>\\sqrt{nd}</math>)",
"~" .. utils._round(he.harmonic_entropy(cents), 6) .. " bits",
})
end
end
end