Module:Infobox interval: Difference between revisions
mNo edit summary |
I need to find the name in a more predictable place |
||
| Line 191: | Line 191: | ||
end | end | ||
local name = frame.args['Name'] | local name = frame.args['Name'] | ||
if value_provided(name) then | if value_provided(name) then | ||
| Line 330: | Line 291: | ||
end | end | ||
local is_comma = value_provided(frame.args['Comma']) | |||
local comma = nil | |||
if is_comma and regular and cents > 0 then | |||
if rational and rat.is_power(ratio) then | |||
-- rational powers are not considered commas | |||
elseif cents <= 3.5 then | |||
comma = '[[Unnoticeable comma|unnoticeable]]' | |||
cats = cats .. '[[Category:Unnoticeable commas]]' | |||
elseif cents <= 30 then | |||
comma = '[[Small comma|small]]' | |||
cats = cats .. '[[Category:Small commas]]' | |||
elseif cents <= 100 then | |||
comma = '[[Medium comma|medium]]' | |||
cats = cats .. '[[Category:Medium commas]]' | |||
else | |||
comma = '[[Large comma|large]]' | |||
cats = cats .. '[[Category:Large commas]]' | |||
end | |||
end | |||
if comma then | |||
table.insert(infobox_data, { | |||
'[[Comma|Comma size]]', | |||
comma | |||
}) | |||
end | |||
if comma and rational then | |||
local S_expressions = rat.find_S_expression(ratio) | |||
if #S_expressions > 0 then | |||
local caption = '[[Square superparticular|S-expression]]' | |||
if #S_expressions > 1 then | |||
caption = caption .. 's' | |||
end | |||
table.insert(infobox_data, { | |||
caption, | |||
table.concat(S_expressions, ',<br/>') | |||
}) | |||
end | |||
end | |||
local sound = frame.args['Sound'] | local sound = frame.args['Sound'] | ||
if value_provided(sound) then | if value_provided(sound) then | ||