Module:Interval edo approximation: Difference between revisions
m hiding tables, sorting by column, adding cent values |
No edit summary |
||
| Line 146: | Line 146: | ||
local output = {} | local output = {} | ||
table.insert(output, '{| class="wikitable mw-collapsible sortable"') | table.insert(output, '{| class="wikitable mw-collapsible sortable"') | ||
table.insert(output, '|+ EDO Approximations for ' | |||
-- Calculate the precise ratio in cents for the caption | |||
local ratio_cents = cents(ratio) | |||
table.insert(output, string.format('|+ EDO Approximations for %s (%.2f¢)', interval_str, ratio_cents)) | |||
table.insert(output, '|-') | table.insert(output, '|-') | ||
table.insert(output, string.format('| colspan="5" style="text-align:center; font-size:90%%;" | \'\'Up to %dedo, Tolerance: ≤%g%%%%\'\'', max_edo, tolerance)) | -- Use class="sortbottom" to exclude subtitle from sorting logic | ||
table.insert(output, string.format('| colspan="5" class="sortbottom" style="text-align:center; font-size:90%%;" | \'\'Up to %dedo, Tolerance: ≤%g%%%%\'\'', max_edo, tolerance)) | |||
table.insert(output, '|-') | table.insert(output, '|-') | ||
table.insert(output, '! EDO !! Step size !! ([[Cent| | table.insert(output, '! EDO !! Step size !! Approximation ([[Cent|¢]]) !! Absolute Error ([[Cent|¢]]) !! [[Relative_interval_error|Relative Error]] ([[Relative_cent|%]])') | ||
for _, result in ipairs(results) do | for _, result in ipairs(results) do | ||