Module:Interval edo approximation: Difference between revisions

m Fix typo that made this module say relative error greater than or equal to some percentage instead of less than or equal
Pailiaq (talk | contribs)
No edit summary
Line 117: Line 117:
     local args = frame.args
     local args = frame.args
     local interval_str = args.interval or args[1]
     local interval_str = args.interval or args[1]
 
local interval_name = args.interval_name  -- Optional display name
     -- Convert string parameters to numbers using config defaults
     -- Convert string parameters to numbers using config defaults
     local tolerance = tonumber(args.tolerance) or DEFAULT_TOLERANCE
     local tolerance = tonumber(args.tolerance) or DEFAULT_TOLERANCE
Line 150: Line 150:
     local ratio_cents = cents(ratio)
     local ratio_cents = cents(ratio)
     -- Include subtitle info in caption to avoid breaking sortable functionality
     -- Include subtitle info in caption to avoid breaking sortable functionality
    table.insert(output, '|+ style="font-size: 105%;" | '
local display_name = interval_name or interval_str
    .. string.format('Edo approximations for %s (%.2f{{c}})<br /><span style="font-size: 0.75em;">\'\'&le;&nbsp;%dedo, relative error &le;&nbsp;%g%%\'\'</span>',
 
    interval_str, ratio_cents, max_edo, tolerance))
table.insert(output, '|+ style="font-size: 105%;" | '
    .. string.format('Edo approximations for %s (%.2f{{c}})<br /><span style="font-size: 0.75em;">\'\'&le;&nbsp;%dedo, relative error &le;&nbsp;%g%%\'\'</span>',
        display_name, ratio_cents, max_edo, tolerance))
     table.insert(output, '|-')
     table.insert(output, '|-')
     table.insert(output, '! Edo'
     table.insert(output, '! Edo'