Anonymous user
Module:Convert: Difference between revisions
update from sandbox per Template talk:Convert#Module version 13
(update from sandbox per Template talk:Convert#Module version 12) |
(update from sandbox per Template talk:Convert#Module version 13) |
||
Line 911:
end
return sep .. id .. mid
end
Line 1,279 ⟶ 1,271:
-- with the hands unit (not worth adding code to enforce that).
------------------------------------------------------------------------
local leading_plus, prefix, numstr, slashes, denstr =
text:match('^%s*(%+?)%s*(.-)%s*(%d+)%s*(/+)%s*(%d+)%s*$')
Line 1,293 ⟶ 1,284:
return nil
end
local whole, wholestr
if prefix == '' then
wholestr = ''
Line 1,359 ⟶ 1,350:
while #remainder > 0 do
local ref, spaces
ref, spaces, remainder = remainder:match('^(\
if ref then
table.insert(refs, ref)
Line 1,460 ⟶ 1,451:
end
end
if isnegative and (value ~= 0) then
value = -value
altvalue = -(altvalue or value)
end
return true, {
value = value,
altvalue = altvalue or value,
singular = singular,
clean = clean,
Line 1,486 ⟶ 1,476:
local number = tonumber(to_en(text))
if number then
local
return number, (fracpart == 0)
end
Line 2,168 ⟶ 2,158:
local fudge = 1e-14 -- {{Order of magnitude}} adds this, so we do too
local prec, minprec, adjust
local subunit_ignore_trailing_zero
local subunit_more_precision -- kludge for "in" used in input like "|2|ft|6|in"
Line 2,468 ⟶ 2,457:
outvalue = -outvalue
end
local
local denominator = out_current.frac
if denominator then
Line 2,936 ⟶ 2,925:
local abbr_org = parms.abbr_org
local adjectival = parms.opt_adjectival
local lk = parms.lk
local want_link = (lk == 'on' or lk == inout)
Line 3,514 ⟶ 3,502:
local success, parms, in_unit_table = get_parms(frame:getParent().args)
if success then
for
success, result, out_unit_table = process(parms, in_unit_table, out_unit_table)
if success and parms.do_convert_again then
|