Module:Convert: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(fix default precision when input includes a fraction) |
(for a "per" unit, use any specified link rather than constructing it) |
||
Line 496: | Line 496: | ||
if per then |
if per then |
||
local result = { utype = t.utype, per = {} } |
local result = { utype = t.utype, per = {} } |
||
override_from(result, t, { ' |
override_from(result, t, { 'invert', 'iscomplex', 'default', 'link', 'symbol', 'symlink' }) |
||
result.symbol_raw = (result.symbol or false) -- to distinguish between a defined exception and a metatable calculation |
result.symbol_raw = (result.symbol or false) -- to distinguish between a defined exception and a metatable calculation |
||
local cvt = result.per |
local cvt = result.per |
||
Line 2,100: | Line 2,100: | ||
else |
else |
||
result = per_word .. ' ' |
result = per_word .. ' ' |
||
end |
|||
if want_link and unit_table.link then |
|||
result = (unit1 and unit1[key_id] or '') .. result .. unit2[key_id2] |
|||
return make_link(unit_table.link, result, unit_table) |
|||
end |
end |
||
if unit1 then |
if unit1 then |