Module:Scale tree: Difference between revisions
/ -> : |
Moved step ratio ranges to hardness column, not step ratio column |
||
| Line 134: | Line 134: | ||
-- Cell for step ratio | -- Cell for step ratio | ||
local step_ratio_as_text = string.format("%d:%d", step_ratio[1], step_ratio[2]) | local step_ratio_as_text = string.format("%d:%d", step_ratio[1], step_ratio[2]) | ||
result = result .. string.format("| %s\n", step_ratio_as_text) | |||
-- Cell for hardness, with divide-by-zero check | |||
-- Include appropriate tamnams name for specific step ratios | |||
local hardness = string.format("%.3f", step_ratio[1] / step_ratio[2]) | |||
if step_ratio_as_text == "1:1" then | if step_ratio_as_text == "1:1" then | ||
result = result .. string.format("| %s (equalized)\n", | result = result .. string.format("| %s (equalized)\n", hardness) | ||
elseif step_ratio_as_text == "4:3" then | elseif step_ratio_as_text == "4:3" then | ||
result = result .. string.format("| %s (supersoft)\n", | result = result .. string.format("| %s (supersoft)\n", hardness) | ||
elseif step_ratio_as_text == "3:2" then | elseif step_ratio_as_text == "3:2" then | ||
result = result .. string.format("| %s (soft)\n", | result = result .. string.format("| %s (soft)\n", hardness) | ||
elseif step_ratio_as_text == "5:3" then | elseif step_ratio_as_text == "5:3" then | ||
result = result .. string.format("| %s (semisoft)\n", | result = result .. string.format("| %s (semisoft)\n", hardness) | ||
elseif step_ratio_as_text == "2:1" then | elseif step_ratio_as_text == "2:1" then | ||
result = result .. string.format("| %s (basic)\n", | result = result .. string.format("| %s (basic)\n", hardness) | ||
elseif step_ratio_as_text == "5:2" then | elseif step_ratio_as_text == "5:2" then | ||
result = result .. string.format("| %s (semihard)\n", | result = result .. string.format("| %s (semihard)\n", hardness) | ||
elseif step_ratio_as_text == "3:1" then | elseif step_ratio_as_text == "3:1" then | ||
result = result .. string.format("| %s (hard)\n", | result = result .. string.format("| %s (hard)\n", hardness) | ||
elseif step_ratio_as_text == "4:1" then | elseif step_ratio_as_text == "4:1" then | ||
result = result .. string.format("| %s (superhard)\n", | result = result .. string.format("| %s (superhard)\n", hardness) | ||
elseif step_ratio_as_text == "1:0" then | elseif step_ratio_as_text == "1:0" then | ||
result = result .. string.format("| | result = result .. string.format("| → ∞ (collapsed)\n", hardness) | ||
else | else | ||
result = result .. string.format("| %s\n", hardness) | |||
end | end | ||
-- Cell for comment | -- Cell for comment | ||