Jump to content

Module:Convert/extra

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Johnuniq (talk | contribs) at 00:52, 10 August 2013 (add $/km and $/mi). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

--[=[ Extra conversion data used by Module:Convert.

[[Module:Convert/data]] defines all units and is transcluded in all pages
where [[Module:Convert]] is used. Testing new units by editing that module
would invalidate the cache for all affected pages.

For quick changes and experiments with new units, this module can be edited.
Since this module would be transcluded in only a small number of pages,
changes should cause little server overhead and should propagate quickly.
]=]

local extra_units = {
    -- TODO: Remove following tests.
    ["RDF"] = { target = "DF" },        -- redirect to new unit defined below
    ["RM"] = { target = "m" },          -- redirect to "m" in [[Module:Convert/data]]
    ["xyz"] = { target     = "xyz" },
    ["J/DM"] = {
	per	 = { "J", "DM" },
	utype	 = "energy per unit length",
	default	 = "kJ/km",
    },
    ["DF"] = {
	name1	 = "double foot",
	name2	 = "double feet",
	symbol	 = "dft",
	utype	 = "length",
	scale	 = 0.6096,
	default	 = "m",
    },
    ["DM"] = {
	_name1	 = "double metre",
	_name1_us = "double meter",
	_symbol	 = "Dm",
	utype	 = "length",
	scale	 = 2,
	prefixes = 1,
	default	 = "v > 0 and v < 1.5 ! ftin ! ft",
	link	 = "Double metre",
    },
    ["ina"] = {
	name1	 = "inch",
	name2	 = "inches",
	symbol	 = '<abbr title="inches">in</abbr>',
	utype	 = "length",
	scale	 = 0.0254,
	exception = "subunit_more_precision",
	default	 = "mm",
    },
    ["$/km"] = {
	per	 = { "$", "km" },
	utype	 = "cost $ per unit length",
	default	 = "$/mi",
    },
    ["$/mi"] = {
	per	 = { "$", "mi" },
	utype	 = "cost $ per unit length",
	default	 = "$/km",
    },
}

return { extra_units = extra_units }