Jump to content

Module:Sandbox/SiBr4

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by SiBr4 (talk | contribs) at 20:13, 30 June 2014 (Created page with 'local p = {} function p.width( frame ) local size local ow local oh local wh local w size = frame["args"][1] ow = string.find(size,"\d+px") oh = string.find(s...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}
function p.width( frame )

local size
local ow
local oh
local wh
local w

size = frame["args"][1]

ow = string.find(size,"\d+px")
oh = string.find(size,"x\d+px")
wh = string.find(size,"\d+x\d+px")

if not ow == nil then
  w = string.gsub(size,"(\d+)px","$1")
else
  if not oh == nil then
    w = string.gsub(size,"x(\d+)px","$1")
    w = w * 2
  else
    if not wh == nil then
      w = string.gsub(size,"(\d+)x\d+px","$1")
    end
  end
end

w = w + 5
return w

end
return p