Module:Convert: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(update from sandbox per Template talk:Convert#Module version 19) |
(update from sandbox per Template talk:Convert#Module version 20) |
||
Line 590: | Line 590: | ||
-- This is never called to determine a unit name or link because per units |
-- This is never called to determine a unit name or link because per units |
||
-- are handled as a special case. |
-- are handled as a special case. |
||
-- Similarly, the default output is handled elsewhere |
-- Similarly, the default output is handled elsewhere, and for a symbol |
||
-- this is only called from get_default() for default_exceptions. |
|||
__index = function (self, key) |
__index = function (self, key) |
||
local value |
local value |
||
Line 2,915: | Line 2,916: | ||
local per = unit_table.per |
local per = unit_table.per |
||
if per then |
if per then |
||
local paren1, paren2 = '', '' -- possible parentheses around bottom unit |
|||
local unit1 = per[1] -- top unit_table, or nil |
local unit1 = per[1] -- top unit_table, or nil |
||
local unit2 = per[2] -- bottom unit_table |
local unit2 = per[2] -- bottom unit_table |
||
Line 2,926: | Line 2,928: | ||
return symbol -- for exceptions that have the symbol built-in |
return symbol -- for exceptions that have the symbol built-in |
||
end |
end |
||
end |
|||
if (unit2.symbol):find('⋅', 1, true) then |
|||
paren1, paren2 = '(', ')' |
|||
end |
end |
||
end |
end |
||
Line 2,965: | Line 2,970: | ||
unit_table.sep = '' |
unit_table.sep = '' |
||
end |
end |
||
return result .. linked_id(parms, unit2, key_id2, want_link, '1') |
return result .. paren1 .. linked_id(parms, unit2, key_id2, want_link, '1') .. paren2 |
||
end |
end |
||
if multiplier then |
if multiplier then |