Module:OOOInfoBox: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 44: | Line 44: | ||
if v == nil or v == '' then return nil end | if v == nil or v == '' then return nil end | ||
return tostring(v) .. (unit or '') | return tostring(v) .. (unit or '') | ||
end | |||
local function format_price(v) | |||
if not v then return nil end | |||
local n = tonumber(v) | |||
if not n then return v end | |||
local s = tostring(math.floor(n)) | |||
s = s:reverse():gsub("(%d%d%d)", "%1 "):reverse():gsub("^ ", "") | |||
return s .. ".-" | |||
end | end | ||