Moduł:Okres istnienia grupy organizmów 2
Wygląd
|
Zobacz podstrony tego modułu.
|
local p = {}
function p.Text(frame)
local from = frame.args[1]
local to = frame.args[2]
-- Numbers get different treatment, they are not parsed by the translation template
from = tonumber(from) or frame:expandTemplate{ title='Okres istnienia grupy organizmów 2/przetłumacz', args={ from } }
if to ~= nil and to ~= '' then
to = tonumber(to) or frame:expandTemplate{ title='Okres istnienia grupy organizmów 2/przetłumacz', args={ to } }
else
-- Standardize empty values to nil for easy checks later on
to = nil
end
local isNumberFrom = (type(from) == 'number')
local isNumberTo = (type(to) == 'number')
if isNumberFrom then
from = frame:callParserFunction('formatnum', from)
end
if isNumberTo then
to = frame:callParserFunction('formatnum', to)
end
if isNumberTo then
to = to .. ' mln lat temu'
elseif isNumberFrom then
from = from .. ' mln lat temu'
end
local range = from
if to ~= nil then
range = range .. '–' .. to
end
return range
end
return p