View source for Module:Convert/helper
From The Goon Show Depository
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
-- This module provides some functions to prepare template parameters
-- for use with Template:Convert.
-- This module is not used by Template:Convert or Module:Convert.
local function stripToNil(text)
-- If text is a non-empty string, return its trimmed content,
-- otherwise return nothing (empty string or not a string).
if type(text) == 'string' then
return text:match('(%S.-)%s*$')
end
end
-- Remove commas and references (any strip markers) from a number.
-- First usage in Template:Infobox_UK_place/dist (June 2018)
local function cleanNumber(frame)
local args = frame.args
local text = stripToNil(args[1]) or ''
if text == '' or tonumber(text) then
return text
end
000
1:0
Template used on this page:
Return to Module:Convert/helper.