Module:Convert/text: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(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: | Line 143: | ||
["x"] = { off = " by ", on = " × ", abbr_range_x = true }, |
["x"] = { off = " by ", on = " × ", abbr_range_x = true }, |
||
["xx"] = " × ", |
["xx"] = " × ", |
||
⚫ | |||
["*"] = "×", -- 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}} |
["/"] = " / ", -- for a table of high/low temperatures with {{convert|83|/|63|F|disp=br()|abbr=values}} |
||
} |
} |
||
Line 149: | Line 149: | ||
local range_aliases = { |
local range_aliases = { |
||
-- ["alternative name for a range"] = "standard range name" |
-- ["alternative name for a range"] = "standard range name" |
||
⚫ | |||
["–"] = "-", |
["–"] = "-", |
||
["–"] = "-", |
["–"] = "-", |
||
["to-"] = "to(-)", |
|||
["×"] = "x", |
["×"] = "x", |
||
["×"] = "x", |
["×"] = "x", |
||
Line 183: | Line 181: | ||
["lang"] = "lang", |
["lang"] = "lang", |
||
["lk"] = "lk", |
["lk"] = "lk", |
||
["near"] = "near", |
|||
["order"] = "order", |
["order"] = "order", |
||
["qid"] = "qid", |
["qid"] = "qid", |
||
Line 214: | Line 211: | ||
["abbr"] = { |
["abbr"] = { |
||
-- ["local text for option value"] = "en value used in this module" |
-- ["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") |
["def"] = "", -- ignored (some wrapper templates call convert with "abbr=def" to mean "default abbreviation") |
||
["h"] = "on", -- abbr=on + use "h" for hand unit (default) |
["h"] = "on", -- abbr=on + use "h" for hand unit (default) |
||
["hh"] = "opt_hand_hh", -- abbr=on + use "hh" for hand unit |
["hh"] = "opt_hand_hh", -- abbr=on + use "hh" for hand unit |
||
["in"] = "in", -- use symbol for LHS 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" |
["none"] = "off", -- old name for "off" |
||
["off"] = "off", -- use name for all units |
["off"] = "off", -- use name for all units |
||
Line 229: | Line 224: | ||
}, |
}, |
||
["adj"] = { |
["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 " " 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) |
["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) |
["off"] = "", -- ignored (off is the default) |
||
["on"] = "opt_adjectival", -- unit name is singular and hyphenated |
["on"] = "opt_adjectival", -- unit name is singular and hyphenated |
||
Line 246: | Line 237: | ||
["gaps"] = "opt_gaps", -- use gaps, not numsep, to separate groups of digits |
["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 |
["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 |
["off"] = "opt_nocomma", -- no numsep in input or output numbers |
||
}, |
}, |
||
Line 253: | Line 243: | ||
}, |
}, |
||
["disp"] = { |
["disp"] = { |
||
[" |
["5"] = "opt_round=5?", -- round output value to nearest 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: '(...)' |
["b"] = "b", -- join: '(...)' |
||
["(or)"] = "(or)", -- join: '(...)' with 'or' between outputs in a combination |
["(or)"] = "(or)", -- join: '(...)' with 'or' between outputs in a combination |
||
Line 262: | Line 250: | ||
["comma"] = "comma", -- join: ',' |
["comma"] = "comma", -- join: ',' |
||
["flip"] = "opt_flip", -- reverse order of input/output |
["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) |
["number"] = "opt_output_number_only", -- display output value (not input, and not output symbol/name) |
||
["or"] = "or", -- join: 'or' |
["or"] = "or", -- join: 'or' |
||
Line 270: | Line 256: | ||
["output only"] = "opt_output_only", |
["output only"] = "opt_output_only", |
||
["preunit"] = "opt_two_preunits", -- user-specified text before input and output units |
["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: '[...]' |
["sqbr"] = "sqbr", -- join: '[...]' |
||
["table"] = "opt_table", -- output is suitable for a table cell with align="right" |
["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" |
["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"] = "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 |
["unit or text"] = "opt_input_unit_only, opt_ignore_error", -- display input symbol/name, or given unit code if not known |
||
Line 292: | Line 275: | ||
["on"] = "on", -- link all unit names or symbols (but not twice for the same unit) |
["on"] = "on", -- link all unit names or symbols (but not twice for the same unit) |
||
["out"] = "out", -- link RHS unit name or symbol |
["out"] = "out", -- link RHS unit name or symbol |
||
}, |
|||
["near"] = { |
|||
["5"] = "opt_round=5?", -- round output value to nearest 5 |
|||
}, |
}, |
||
["order"] = { |
["order"] = { |
||
Line 313: | Line 293: | ||
["sortable"] = { |
["sortable"] = { |
||
["off"] = "", -- ignored (off is the default) |
["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 |
["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"] = { |
["sp"] = { |