Module:Powharmonic series: Difference between revisions
ArrowHead294 (talk | contribs) No edit summary |
ArrowHead294 (talk | contribs) No edit summary |
||
| Line 16: | Line 16: | ||
"! Change (cents)\n" .. | "! Change (cents)\n" .. | ||
"! Octave-reduced (cents)\n" | "! Octave-reduced (cents)\n" | ||
local | local fmt_cent = string.format("%%.%df", tonumber(frame.args["prec"])) | ||
local p_prev = 0 | local p_prev = 0 | ||
local p_current = 0 | local p_current = 0 | ||
| Line 27: | Line 26: | ||
"| " .. i .. "\n" .. | "| " .. i .. "\n" .. | ||
"| " .. i .. "<sup>" .. expo .. "</sup>\n" .. | "| " .. i .. "<sup>" .. expo .. "</sup>\n" .. | ||
"| " .. string.format( | "| " .. string.format(fmt_cent, i^expo) .. "\n" .. | ||
"| " .. string.format(fmt_cent, p_current) .. "\n" .. | "| " .. string.format(fmt_cent, p_current) .. "\n" .. | ||
"| " .. string.format(fmt_cent, p_current - p_prev) .. "\n" .. | "| " .. string.format(fmt_cent, p_current - p_prev) .. "\n" .. | ||