Module:Convert/text: Difference between revisions

update from sandbox per Template talk:Convert#Module version 21; this removes many deprecated options
(update from sandbox per Template talk:Convert#Module version 20)
(update from sandbox per Template talk:Convert#Module version 21; this removes many deprecated options)
Line 143:
["x"] = { off = " by ", on = " × ", abbr_range_x = true },
["xx"] = " × ",
["&*"] = "and×",
["*"] = "×", -- use "*" to replace "x" in {{convert/2}} which is different from "x" in old {{convert}}
["/"] = " / ", -- for a table of high/low temperatures with {{convert|83|/|63|F|disp=br()|abbr=values}}
}
Line 149:
local range_aliases = {
-- ["alternative name for a range"] = "standard range name"
["&"] = "and",
["–"] = "-",
["–"] = "-",
["to-"] = "to(-)",
["×"] = "x",
["×"] = "x",
Line 183 ⟶ 181:
["lang"] = "lang",
["lk"] = "lk",
["near"] = "near",
["order"] = "order",
["qid"] = "qid",
Line 214 ⟶ 211:
["abbr"] = {
-- ["local text for option value"] = "en value used in this module"
["comma"] = "opt_nocomma?", -- no numsep in input or output numbers
["def"] = "", -- ignored (some wrapper templates call convert with "abbr=def" to mean "default abbreviation")
["h"] = "on", -- abbr=on + use "h" for hand unit (default)
["hh"] = "opt_hand_hh", -- abbr=on + use "hh" for hand unit
["in"] = "in", -- use symbol for LHS unit
["mos"] = "mos", -- in a range, repeat the input unit (no longer used)
["none"] = "off", -- old name for "off"
["off"] = "off", -- use name for all units
Line 229 ⟶ 224:
},
["adj"] = {
["1"] = "opt_singular", -- unit name is singular when value satisfies: (-1 <= v and v < 0) or (0 < v and v <= 1)
["flip"] = "opt_flip?", -- reverse order of input/output
["j"] = "opt_use_nbsp", -- "join": use "&nbsp;" instead of " " between value and unit name
["mid"] = "opt_adjectival, opt_adj_mid", -- adj=on with user-specified text after input unit (between input and output)
["nocomma"] = "opt_nocomma?", -- no numsep in input or output numbers
["off"] = "", -- ignored (off is the default)
["on"] = "opt_adjectival", -- unit name is singular and hyphenated
Line 246 ⟶ 237:
["gaps"] = "opt_gaps", -- use gaps, not numsep, to separate groups of digits
["gaps3"] = "opt_gaps, opt_gaps3", -- group only in threes rather than default of no gap before a single digit after decimal mark
["gaps5"] = "opt_gaps?", -- deprecated 2015-05-29, was: opt_gaps + opt_comma5
["off"] = "opt_nocomma", -- no numsep in input or output numbers
},
Line 253 ⟶ 243:
},
["disp"] = {
["/5"] = "oropt_round=5?", -- round output value to nearest -- see "slash"5
["2"] = "opt_output_only?", -- display only output value and symbol/name (not input)
["5"] = "opt_round=5", -- round output value to nearest 5
["b"] = "b", -- join: '(...)'
["(or)"] = "(or)", -- join: '(...)' with 'or' between outputs in a combination
Line 262 ⟶ 250:
["comma"] = "comma", -- join: ','
["flip"] = "opt_flip", -- reverse order of input/output
["flip5"] = "opt_flip, opt_round=5?", -- disp=flip + disp=5
["nocomma"] = "opt_nocomma?", -- no numsep in input or output numbers
["number"] = "opt_output_number_only", -- display output value (not input, and not output symbol/name)
["or"] = "or", -- join: 'or'
Line 270 ⟶ 256:
["output only"] = "opt_output_only",
["preunit"] = "opt_two_preunits", -- user-specified text before input and output units
["s"] = "or?", -- see "slash"
["slash"] = "or?", -- 2014-11-03: "disp=slash" is now equivalent to "disp=or" as slash is unhelpful
["sqbr"] = "sqbr", -- join: '[...]'
["table"] = "opt_table", -- output is suitable for a table cell with align="right"
["tablecen"] = "opt_tablecen", -- output is suitable for a table cell with align="center"
["u2"] = "opt_output_unit_only?", -- display output symbol/name (not input, and not output value)
["unit"] = "opt_input_unit_only", -- display input symbol/name (not output, and not input value)
["unit or text"] = "opt_input_unit_only, opt_ignore_error", -- display input symbol/name, or given unit code if not known
Line 292 ⟶ 275:
["on"] = "on", -- link all unit names or symbols (but not twice for the same unit)
["out"] = "out", -- link RHS unit name or symbol
},
["near"] = {
["5"] = "opt_round=5?", -- round output value to nearest 5
},
["order"] = {
Line 313 ⟶ 293:
["sortable"] = {
["off"] = "", -- ignored (off is the default)
["in"] = "opt_sortable_on?", -- same as "on"
["on"] = "opt_sortable_on", -- output sort key for use in a sortable table, based on value from converting to a standard base unit
["out"] = "opt_sortable_on?", -- same as "on"
},
["sp"] = {
Anonymous user