Template:Convert/testcases/range

From MattWiki
Jump to: navigation, search

Test {convert} (module) versus old {convert} (wikicode)

2013
  • {{convert}} compared with {{convert/sandboxlua}}
Convert Code Convert (Old) Convert (Sandboxlua) Result
{{convert|5|to|12|kg}} 5 to 12 kilograms (11 to 26 lb) 5 to 12 kilograms (11 to 26 lb) Exact Match
{{convert|5|to|12|kg|abbr=off}} 5 to 12 kilograms (11 to 26 pounds) 5 to 12 kilograms (11 to 26 pounds) Exact Match
{{convert|5|to(-)|12|kg}} 5 to 12 kilograms (11–26 lb) 5 to 12 kilograms (11–26 lb) Exact Match
{{convert|5|to|12|kg|abbr=off}} 5 to 12 kilograms (11 to 26 pounds) 5 to 12 kilograms (11 to 26 pounds) Exact Match
{{convert|5|-|12|kg|lb|abbr=off}} 5–12 kilograms (11–26 pounds) 5–12 kilograms (11–26 pounds) Exact Match
{{convert|5|and|12|kg}} 5 and 12 kilograms (11 and 26 lb) 5 and 12 kilograms (11 and 26 lb) Exact Match
{{convert|60|by|120|m|ft|abbr=off}} 60 by 120 metres (200 by 390 feet) 60 by 120 metres (200 by 390 feet) Exact Match
{{convert|60|x|120|m|ft|abbr=on}} 60 × 120 m (200 × 390 ft) 60 m × 120 m (200 ft × 390 ft) Different
{{convert|1|x|1|m|ft|sp=us}} 1 by 1 meters (3.3 × 3.3 ft) 1 by 1 meter (3.3 ft × 3.3 ft) Different
{{convert|45|+/-|8|mm}} 45 ± 8 millimetres (1.8 ± 0.31 in) 45 ± 8 millimetres (1.77 ± 0.31 in) Different
{{convert|3|±|4|in|mm}} 3 ± 4 inches (76 ± 100 mm) 3 ± 4 inches (76 ± 102 mm) Different
{{convert|3|and(-)|4|in|mm}} 3 and 4 inches (76 and 100 mm) 3 and 4 inches (76–102 mm) Different
{{convert|3|&|4|in|mm}} Template:Convert/& 3 and 4 inches (76 and 102 mm)
{{convert|3|–|4|in|mm}} 3–4 inches (76–100 mm) 3–4 inches (76–102 mm) Different
{{convert|3|to-|4|in|mm}} 3 to 4 inches (76–100 mm) 3 to 4 inches (76–102 mm) Different
{{convert|3|×|4|in|mm}} 3 by 4 inches (76 × 100 mm) 3 by 4 inches (76 mm × 102 mm) Different
{{convert|8|xx|10|ft|m}} 8 × 10 feet (2.4×3.0 m) 8 × 10 feet (2.4 × 3.0 m) Different
{{convert|8|xx|10|ft|m|adj=on}} 8-×-10-foot (2.4×3.0 m) 8-×-10-foot (2.4 × 3.0 m) Different
{{convert|8|xx|10|ft|m|abbr=on}} 8×10 ft (2.4×3.0 m) 8 × 10 ft (2.4 × 3.0 m) Different
{{convert|8|xx|10|ft|m|abbr=off}} 8 × 10 feet (2.4 × 3.0 metres) 8 × 10 feet (2.4 × 3.0 metres) Exact Match
{{convert|1|and|10|ft|m}} 1 and 10 feet (0.30 and 3.0 m) 1 and 10 feet (0.30 and 3.05 m) Different
{{convert|1|and|10|ft|m|adj=on}} 1-and-10-foot (0.30 and 3.0 m) 1-and-10-foot (0.30 and 3.05 m) Different
{{convert|1|and|10|ft|m|abbr=on|adj=on}} 1-and-10 ft (0.30-and-3.0 m) 1-and-10 ft (0.30-and-3.05 m) Different
{{convert|1|by|10|ft|m}} 1 by 10 feet (0.30 by 3.0 m) 1 by 10 feet (0.30 by 3.05 m) Different
{{convert|1|by|10|ft|m|adj=on}} 1-by-10-foot (0.30 by 3.0 m) 1-by-10-foot (0.30 by 3.05 m) Different
{{convert|-8|-|-3|F|C}} −8 – −3 °F (−22.2–−19.4 °C) −8 – −3 °F (−22 – −19 °C) Different


Range input by multiple parameters (classic)

  • Testing range input like {{Convert|5|to|12|kg|abbr=off}}.
In some cases, parameters are set: |sp=us, |abbr=, |adj=.
{convert/3} variants no check needed.
Parameter effects not explored to the full (|abbr=on may change output symbol?).
The final row has negative values (by hyphen)
to
  1. 5 to 12 kilograms (11 to 26 pounds) -hyphen for minus sign
  2. −125 to −12 kilograms (−276 to −26 lb) -hyphen for minus sign
  3. −125 to −12 kilograms (−276 to −26 pounds) -hyphen for minus sign
to (using minus signs)
  1. −125 to −12 kilograms (−276 to −26 pounds) --|−125|to|−12|minus sign before numbers
  2. −125 – −12 kilograms (−276 – −26 pounds) --|−125|-|−12|minus sign before numbers, hyphen range sep
  3. −125 −[convert: unknown unit] --minus sign as range sep |-125|−|-12| Won't fix
to(-)
  1. 5 to 12 kilograms (11–26 lb)
  2. −5 to −12 kilograms (−11 – −26 lb)
to-
  1. 3 to 4 inches (76–102 mm)
  2. −3 to −4 inches (−76 – −102 mm)
and
  1. 5 and 12 kilograms (11 and 26 lb)
  2. 1 and 10 feet (0.30 and 3.05 m)
  3. 1-and-10-foot (0.30 and 3.05 m)
  4. 1-and-10 ft (0.30-and-3.05 m)
  5. −1-and-−10 ft (−0.30-and-−3.05 m)
and(-)
  1. 3 and 4 inches (76–102 mm)
  2. 3 and 4 in (76–102 mm)
  3. −3 and −4 in (−76 – −102 mm)
by
  1. 60 by 120 metres (200 by 390 feet)
  2. 1 by 10 feet (0.30 by 3.05 m)
  3. 1-by-10-foot (0.30 by 3.05 m)
  4. 29 by 19 by 20 inches (74 by 48 by 51 cm)
  5. 50.3 by 103 by 65.5 metres (165 by 338 by 215 ft)
  6. −50.3 by −103 by −65.5 metres (−165 by −338 by −215 ft)
or
  1. 140 or 160 km/h (87 or 99 mph)
  2. 140 or 160 or 200 km/h (87 or 99 or 124 mph)
  3. −140 or −160 or −200 km/h (−87 or −99 or −124 mph)
to about
  1. 140 to about 160 km/h (87 to about 99 mph)
  2. 50 to about 90 °C (122 to about 194 °F; 323 to about 363 K)
  3. 5,000 to about 9,000 °C (9,030 to about 16,230 °F; 5,270 to about 9,270 K)
  4. −50 to about −20 °C (−58 to about −4 °F; 223 to about 253 K)
×
  1. 3 by 4 inches (76 mm × 102 mm)
  2. 100 mm × 210 mm × 110 mm (3.9 in × 8.3 in × 4.3 in)
  3. −100 mm × −210 mm × −110 mm (−3.9 in × −8.3 in × −4.3 in)
x
  1. 60 m × 120 m (200 ft × 390 ft) --abbr=on
  2. 1 by 1 meter (3.3 ft × 3.3 ft) -- |1|x|1| sp=us
  3. 109 mm × 60 mm × 14 mm (4.29 in × 2.36 in × 0.55 in) -- abbr=on
  4. 35 by 75 by 17 metres (115 ft × 246 ft × 56 ft)
  5. −35 by −75 by −17 metres (−115 ft × −246 ft × −56 ft)
xx
  1. 8 × 10 feet (2.4 × 3.0 m)
  2. 8-×-10-foot (2.4 × 3.0 m) -- adj=on
  3. 8 × 10 ft (2.4 × 3.0 m) -- abbr=on
  4. 8 × 10 feet (2.4 × 3.0 metres) -- abbr=off
  5. −8 × −10 feet (−2.4 × −3.0 metres) -- abbr=off
*
  1. 60×120 m (200×390 ft) -- abbr=on
  2. 1×1 meter (3.3×3.3 ft) --sp=us
  3. 109×60×14 mm (4.29×2.36×0.55 in) -- abbr=on
  4. 35×75×17 metres (115×246×56 ft)
  5. −35×−75×−17 metres (−115×−246×−56 ft)
- (hyphen)
  1. 5–12 kilograms (11–26 pounds) -- abbr=off
  2. 3 – −4 inches (76 – −102 mm)
  3. −8 – −3 °F (−22 – −19 °C)
  4. 20–30 °F (11–17 °C) -- change
  5. −20 – −30 °F (−11 – −17 °C) -- change
  6. −20–50 °C (−36–90 °F) -- change
  7. −8 – −3 °F (−4.4 – −1.7 °C) -- change
en dash
  1. 5–12 kilograms (11–26 pounds) -- abbr=off
  2. 3 – −4 inches (76 – −102 mm)
  3. −8 – −3 °F (−22 – −19 °C)
  4. 8–13 °F (−13 – −11 °C)
  5. −8 – −3 °F (−4.4 – −1.7 °C) -- C change
+/-
  1. 45 ± 8 millimetres (1.77 ± 0.31 in)
  2. −45 ± −88 millimetres (−1.8 ± −3.5 in)
±
  1. 3 ± 4 inches (76 ± 102 mm)
  2. −3 ± −4 inches (−76 ± −102 mm)
&
  1. 3 and 4 inches (76 and 102 mm)
  2. −3.5 and −4.5 inches (−89 and −114 mm)
,
  1. 1.0, 0.8 and 0.6 metres (3.3, 2.6 and 2.0 ft)
  2. 10, 25, 100 lb (4.5, 11.3, 45.4 kg)
  3. 20, 30, 40 and 50 ft (6.1, 9.1, 12.2 and 15.2 m)
  4. −20, −30, −40 and −50 ft (−6.1, −9.1, −12.2 and −15.2 m)
, and
  1. 1.0, and 0.8 metres (3.3, and 2.6 ft)
  2. 10, and 25 lb (4.5, and 11.3 kg)
  3. 20, and 30 ft (6.1, and 9.1 m)
  4. 1.0, and 0.8, and 10 metres (3.3, and 2.6, and 32.8 ft)
  5. 10, and 25, and 10 lb (4.5, and 11.3, and 4.5 kg)
  6. 20, and 30, and 10 ft (6.1, and 9.1, and 3.0 m)
  7. −20, and −30, and −10 ft (−6.1, and −9.1, and −3.0 m)
, or
  1. 1.0, or 0.8 metres (3.3, or 2.6 ft)
  2. 10, 25, or 100 lb (4.5, 11.3, or 45.4 kg)
  3. 20, or 30, or 40 or 50 ft (6.1, or 9.1, or 12.2 or 15.2 m)
  4. −20, or −30, or −40 or −50 ft (−6.1, or −9.1, or −12.2 or −15.2 m)
, and , or
  1. 20, and 30, and 10, or 99 ft (6.1, and 9.1, and 3.0, or 30.2 m)
  2. 20, and 30, or 10, and 99 ft (6.1, and 9.1, or 3.0, and 30.2 m)
  3. −20, and −30, or −10, and −99 ft (−6.1, and −9.1, or −3.0, and −30.2 m)
  1. [convert: invalid number] --ndash for minus sign, Won't fix
mixed
  1. 3.5, 3.0 and 2.0 m (11 ft 6 in, 9 ft 10 in and 6 ft 7 in)
  2. 1 by 5 to 1 by 8 feet (300 mm × 1,520 mm to 300 mm × 2,440 mm)
  3. 1 ft × 5 ft to 1 ft × 8 ft (300 mm × 1,520 mm to 300 mm × 2,440 mm)
  4. 5 mm–9 mm × 4 mm–9 mm (0.20 in–0.35 in × 0.16 in–0.35 in)
  5. 7.5 cm–16 cm × 3.5 cm–7.5 cm (3.0 in–6.3 in × 1.4 in–3.0 in)
  6. −7.5 cm – −16 cm × −3.5 cm – −7.5 cm (−3.0 in – −6.3 in × −1.4 in – −3.0 in)
number
frac
  1. 2 12 by 1 12 by 1 12 royal cubits (1.31 m × 0.79 m × 0.79 m) --|-2-1/2|x|-1-1/2|x|-1-1/2|royal cubit|
  1. −2 12 by −1 12 by −1 12 royal cubits (−1.31 m × −0.79 m × −0.79 m) --|-2-1/2|x|-1-1/2|x|-1-1/2|royal cubit|
number
sci
  1. 2 12 by 1 12 by 1 12 million metres (1,550 mi × 930 mi × 930 mi) --|2+1/2|x|1+1/2|x|1+1/2|e6m|mi}}
  2. 2 by 1 by 4 billion metres (1,240,000 mi × 620,000 mi × 2,490,000 mi) --
  3. −2 12 by −1 12 by −1 12 million metres (−1,550 mi × −930 mi × −930 mi) --|2+1/2|x|1+1/2|x|1+1/2|e6m|mi}}
  4. −2 by −1 by −4 billion metres (−1,240,000 mi × −620,000 mi × −2,490,000 mi) --
foo, bar Won't fix
  1. 1.0 foo[convert: unknown unit]
  2. 10 foo[convert: unknown unit]

Range by single parameter input

  • Testing range input like {{Convert/sandbox|5 to 12|kg|abbr=off}}.
In some cases, parameters are set: |sp=us, |abbr=, |adj=.
{convert/3} variants no check needed.
Parameter effects not explored to the full (|abbr=on may change output symbol?).
The final row has negative values (by hyphen)
to
  1. -hyphen for minus sign
  2. -hyphen for minus sign
  3. -hyphen for minus sign
to (using minus signs)
  1. -- −125 to −12|minus sign before numbers
  2. -- −125 - −12|minus sign before numbers, hyphen range sep
  3. --minus sign as range sep -125 − -12 Won't fix
to(-)
to-
and
and(-)
by
or
to about
×
x
  1. --abbr=on
  2. -- 1 x 1 sp=us
  3. -- abbr=on
xx
  1. -- adj=on
  2. -- abbr=on
  3. -- abbr=off
  4. -- abbr=off
*
  1. -- abbr=on
  2. --sp=us
  3. -- abbr=on
- (hyphen)
  1. -- abbr=off
  2. -- change
  3. -- change
  4. -- change
  5. -- change
en dash
  1. -- abbr=off
  2. -- C change
+/-
±
&
,
, and
, or
, and , or
  1. --ndash for minus sign, Won't fix
mixed
number
frac
  1. -- -2-1/2 x -1-1/2 x -1-1/2|royal cubit
  1. -- -2-1/2 x -1-1/2 x -1-1/2|royal cubit
number
sci
  1. -- 2+1/2 x 1+1/2 x 1+1/2|e6m|mi}}
  2. --
  3. -- 2+1/2 x 1+1/2 x 1+1/2|e6m|mi}}
  4. --
Foo, bar Won't fix