Module:Sharpness documentation: Difference between revisions

Sintel (talk | contribs)
formatting, nits
ArrowHead294 (talk | contribs)
mNo edit summary
Line 7: Line 7:
local notation = frame.args["notation"] or ""
local notation = frame.args["notation"] or ""


-- type: "sharp" or "flat"
-- typ: "sharp" or "flat"
-- value: absolute value of sharpness (the "n" as in sharp-n and flat-n)
-- value: absolute value of sharpness (the "n" as in sharp-n and flat-n)
-- extension: used for identifying alternative symbol set
-- extension: used for identifying alternative symbol set
local type, value, extension = in_str:match("%-(%a*)(%d+)(%a*)")
local typ, value, extension = in_str:match("%-(%a*)(%d+)(%a*)")


-- signed sharpness
-- signed sharpness
local s = tonumber(value)
local s = tonumber(value)
if type == "flat" then
if typ == "flat" then
s = -s
s = -s
end
end