Module:Infobox regtemp: Difference between revisions

Bugfix 1: implement the right algorithm for ploidacot
Bugfix 2: negligences for omega
Line 55: Line 55:
-- process mapping
-- process mapping
local map = {}
local map = {}
for num in mapping:gmatch("(%d+); ") do
for num in mapping:gmatch("(-?%d+); ") do
table.insert(map, num)
table.insert(map, num)
end
end
local lowermap = {}
local lowermap = {}
for num in mapping:gmatch("(%d+) ") do
for num in mapping:gmatch("(-?%d+) ") do
table.insert(lowermap, num)
table.insert(lowermap, num)
end
end
Line 363: Line 363:
local greek
local greek
if string.len(number) == 1 then
if string.len(string.match(number, "(%d+)")) == 1 then
greek = p.digit2greeklet(number, "unit")
greek = p.digit2greeklet(number, "unit")
elseif string.len(number) == 2 then
elseif string.len(string.match(number, "(%d+)")) == 2 then
local unit = string.char(string.byte(number, 2))
local unit = string.char(string.byte(number, 2))
local decade = string.char(string.byte(number, 1))
local decade = string.char(string.byte(number, 1))