Module:Convert/text: Difference between revisions

extra range types needed for ranges of more than two values
(add spell option; use more commonly used comma rather than colon for list)
(extra range types needed for ranges of more than two values)
Line 148:
cvt_bad_default = { 'Unit "%s" has an invalid default', 'unknown' },
cvt_bad_num = { 'Value "%s" must be a number', 'general' },
cvt_bad_num2 = { 'Second value "%s" must be a number', 'general' },
cvt_bad_prec = { 'Parameter precision "%s" must be an integer', 'general' },
cvt_bad_sigfig = { 'Parameter sigfig "%s" must be a positive integer', 'general' },
Line 159 ⟶ 158:
cvt_no_default = { 'Unit "%s" has no default output unit', 'unknown' },
cvt_no_num = { 'Need value', 'general' },
cvt_no_num2 = { 'Need secondanother value', 'general' },
cvt_no_unit = { 'Need name of unit', 'unknown' },
cvt_should_be = { '%s', 'general', regex = unitcode_regex, replace = unitcode_replace },
Line 182 ⟶ 181:
-- Text to separate values in a range.
local range_types = {
["+"] = " + ",
[","] = ", ",
[", and"] = ", and ",
[", or"] = ", or ",
["by"] = " by ",
["-"] = "–",
["to about"] = " to about ",
["and"] = { ["off"] = " and ", ["on"] = " and ", exception = true },
["or"] = { ["off"] = " or " , ["on"] = " or " , exception = true },
["to"] = { ["off"] = " to " , ["on"] = " to " , exception = true },
["to(-)"] = { off = " to ", on = "–" },
["+/-"] = { ["off"] = " ± ", ["on"] = " ± ", ["adj"] = " ± " },
["x"] = { ["off"] = " by ", ["on"] = " × ", is_range_x = true },
["xx"] = " × ",
["to(-)*"] = { [ = "off×"], = -- use " *" to ",replace ["onx"] =in {{convert/2}} which is different from "x" in old {{convert}},
["+/-"] = { ["off"] = " ± ", ["on"] = " ± ", ["adj"] = " ± " },
["x"] = { ["off"] = " by ", ["on"] = " × ", is_range_x = true },
}
 
Anonymous user