Module:Simplified fraction: Difference between revisions

Tristanbay (talk | contribs)
more stupid mistake fixing, also testing
Tristanbay (talk | contribs)
fixing the stupidest mistake of all?
Line 14: Line 14:


function p.simfrac(frame)
function p.simfrac(frame)
local n = 14
local n = frame.args["n"]
local d = 9
local d = frame.args["d"]
local num, denom = simplify(n, d)
local num, denom = simplify(n, d)
local whole = true and math.floor(num / denom) or 0
local whole = frame.args["mixed"] and math.floor(num / denom) or 0
local ft
local ft
if denom == 1 then
if denom == 1 then
Line 28: Line 28:
return frame:preprocess(ft)
return frame:preprocess(ft)
end
end
return p