Template:Convert/testcases/prefixes

From MattWiki
Jump to: navigation, search

From module:convert/text (currently, only SI prefixes are tested):

from "Ym" to abbr=off

Convert Code Convert (Old) Convert (Sandboxlua) Result
{{convert|1234.56789|m|in|lk=on}} 1,234.56789 metres (48,605.035 in) 1,234.56789 metres (48,605.035 in) Exact Match
{{convert|1234.56789|Ym|in|lk=on}} 1,234.56789 yottametres (4.8605035×1028 in) 1,234.56789 yottametres (4.8605035×1028 in) Exact Match
{{convert|1234.56789|Zm|in|lk=on}} 1,234.56789 zettametres (4.8605035×1025 in) 1,234.56789 zettametres (4.8605035×1025 in) Exact Match
{{convert|1234.56789|Em|in|lk=on}} 1,234.56789 exametres (4.8605035×1022 in) 1,234.56789 exametres (4.8605035×1022 in) Exact Match
{{convert|1234.56789|Pm|in|lk=on}} 1,234.56789 petametres (4.8605035×1019 in) 1,234.56789 petametres (4.8605035×1019 in) Exact Match
{{convert|1234.56789|Tm|in|lk=on}} 1,234.56789 terametres (4.8605035×1016 in) 1,234.56789 terametres (4.8605035×1016 in) Exact Match
{{convert|1234.56789|Gm|in|lk=on}} 1,234.56789 gigametres (4.8605035×1013 in) 1,234.56789 gigametres (4.8605035×1013 in) Exact Match
{{convert|1234.56789|Mm|in|lk=on}} 1,234.56789 megametres (4.8605035×1010 in) 1,234.56789 megametres (4.8605035×1010 in) Exact Match
{{convert|1234.56789|km|in|lk=on}} 1,234.56789 kilometres (48,605,035 in) 1,234.56789 kilometres (48,605,035 in) Exact Match
{{convert|1234.56789|hm|in|lk=on}} 1,234.56789 hectometres (4,860,503.5 in) 1,234.56789 hectometres (4,860,503.5 in) Exact Match
{{convert|1234.56789|dam|in|lk=on}} 1,234.56789 decametres (486,050.35 in) 1,234.56789 decametres (486,050.35 in) Exact Match
{{convert|1234.56789|m|in|lk=on}} 1,234.56789 metres (48,605.035 in) 1,234.56789 metres (48,605.035 in) Exact Match
{{convert|1234.56789|dm|in|lk=on}} 1,234.56789 decimetres (4,860.5035 in) 1,234.56789 decimetres (4,860.5035 in) Exact Match
{{convert|1234.56789|cm|in|lk=on}} 1,234.56789 centimetres (486.05035 in) 1,234.56789 centimetres (486.05035 in) Exact Match
{{convert|1234.56789|mm|in|lk=on}} 1,234.56789 millimetres (48.605035 in) 1,234.56789 millimetres (48.605035 in) Exact Match
{{convert|1234.56789|μm|in|lk=on}} 1,234.56789 micrometres (0.048605035 in) 1,234.56789 micrometres (0.048605035 in) Exact Match
{{convert|1234.56789|µm|in|lk=on}} 1,234.56789 micrometres (0.048605035 in) 1,234.56789 micrometres (0.048605035 in) Exact Match
{{convert|1234.56789|um|in|lk=on}} 1,234.56789 micrometres (0.048605035 in) 1,234.56789 micrometres (0.048605035 in) Exact Match
{{convert|1234.56789|nm|in|lk=on}} 1,234.56789 nanometres (4.8605035×10−5 in) 1,234.56789 nanometres (4.8605035×10−5 in) Exact Match
{{convert|1234.56789|pm|in|lk=on}} 1,234.56789 picometres (4.8605035×10−8 in) 1,234.56789 picometres (4.8605035×10−8 in) Exact Match
{{convert|1234.56789|fm|in|lk=on}} Template:Convert/fm 1,234.56789 femtometres (4.8605035×10−11 in)
{{convert|1234.56789|am|in|lk=on}} Template:Convert/am 1,234.56789 attometres (4.8605035×10−14 in)
{{convert|1234.56789|zm|in|lk=on}} Template:Convert/zm 1,234.56789 zeptometres (4.8605035×10−17 in)
{{convert|1234.56789|ym|in|lk=on}} Template:Convert/ym 1,234.56789 yoctometres (4.8605035×10−20 in)
{{convert|1234.56789|km|m}} 1,234.56789 kilometres (1,234,567.89 m) 1,234.56789 kilometres (1,234,567.89 m) Exact Match


from "Ym" to abbr

Convert Code Convert (Old) Convert (Sandboxlua) Result
{{convert|1234.56789|m|in|lk=on|abbr=on}} 1,234.56789 m (48,605.035 in) 1,234.56789 m (48,605.035 in) Exact Match
{{convert|1234.56789|Ym|in|lk=on|abbr=on}} 1,234.56789 Ym (4.8605035×1028 in) 1,234.56789 Ym (4.8605035×1028 in) Exact Match
{{convert|1234.56789|Zm|in|lk=on|abbr=on}} 1,234.56789 Zm (4.8605035×1025 in) 1,234.56789 Zm (4.8605035×1025 in) Exact Match
{{convert|1234.56789|Em|in|lk=on|abbr=on}} 1,234.56789 Em (4.8605035×1022 in) 1,234.56789 Em (4.8605035×1022 in) Exact Match
{{convert|1234.56789|Pm|in|lk=on|abbr=on}} 1,234.56789 Pm (4.8605035×1019 in) 1,234.56789 Pm (4.8605035×1019 in) Exact Match
{{convert|1234.56789|Tm|in|lk=on|abbr=on}} 1,234.56789 Tm (4.8605035×1016 in) 1,234.56789 Tm (4.8605035×1016 in) Exact Match
{{convert|1234.56789|Gm|in|lk=on|abbr=on}} 1,234.56789 Gm (4.8605035×1013 in) 1,234.56789 Gm (4.8605035×1013 in) Exact Match
{{convert|1234.56789|Mm|in|lk=on|abbr=on}} 1,234.56789 Mm (4.8605035×1010 in) 1,234.56789 Mm (4.8605035×1010 in) Exact Match
{{convert|1234.56789|km|in|lk=on|abbr=on}} 1,234.56789 km (48,605,035 in) 1,234.56789 km (48,605,035 in) Exact Match
{{convert|1234.56789|hm|in|lk=on|abbr=on}} 1,234.56789 hm (4,860,503.5 in) 1,234.56789 hm (4,860,503.5 in) Exact Match
{{convert|1234.56789|dam|in|lk=on|abbr=on}} 1,234.56789 dam (486,050.35 in) 1,234.56789 dam (486,050.35 in) Exact Match
{{convert|1234.56789|m|in|lk=on|abbr=on}} 1,234.56789 m (48,605.035 in) 1,234.56789 m (48,605.035 in) Exact Match
{{convert|1234.56789|dm|in|lk=on|abbr=on}} 1,234.56789 dm (4,860.5035 in) 1,234.56789 dm (4,860.5035 in) Exact Match
{{convert|1234.56789|cm|in|lk=on|abbr=on}} 1,234.56789 cm (486.05035 in) 1,234.56789 cm (486.05035 in) Exact Match
{{convert|1234.56789|mm|in|lk=on|abbr=on}} 1,234.56789 mm (48.605035 in) 1,234.56789 mm (48.605035 in) Exact Match
{{convert|1234.56789|μm|in|lk=on|abbr=on}} 1,234.56789 µm (0.048605035 in) 1,234.56789 µm (0.048605035 in) Exact Match
{{convert|1234.56789|µm|in|lk=on|abbr=on}} 1,234.56789 µm (0.048605035 in) 1,234.56789 µm (0.048605035 in) Exact Match
{{convert|1234.56789|um|in|lk=on|abbr=on}} 1,234.56789 µm (0.048605035 in) 1,234.56789 µm (0.048605035 in) Exact Match
{{convert|1234.56789|nm|in|lk=on|abbr=on}} 1,234.56789 nm (4.8605035×10−5 in) 1,234.56789 nm (4.8605035×10−5 in) Exact Match
{{convert|1234.56789|pm|in|lk=on|abbr=on}} 1,234.56789 pm (4.8605035×10−8 in) 1,234.56789 pm (4.8605035×10−8 in) Exact Match
{{convert|1234.56789|fm|in|lk=on|abbr=on}} Template:Convert/fm 1,234.56789 fm (4.8605035×10−11 in)
{{convert|1234.56789|am|in|lk=on|abbr=on}} Template:Convert/am 1,234.56789 am (4.8605035×10−14 in)
{{convert|1234.56789|zm|in|lk=on|abbr=on}} Template:Convert/zm 1,234.56789 zm (4.8605035×10−17 in)
{{convert|1234.56789|ym|in|lk=on|abbr=on}} Template:Convert/ym 1,234.56789 ym (4.8605035×10−20 in)
{{convert|1234.56789|km|m|abbr=on}} 1,234.56789 km (1,234,567.89 m) 1,234.56789 km (1,234,567.89 m) Exact Match


from "yottametre"

Notes:

See #The prefixes below for the existing articles in these unit names. So we expect no redlinks for them.
From line 2 and 3 (|1=millimetre(s)) I concluded we should use singular.
Apart from "micrometre", no such input is documented. Any testfail is meaningless. -DePiep (talk) 20:08, 12 October 2013 (UTC)
Convert Code Convert (Old) Convert (Sandboxlua) Result
{{convert|1234.56789|metre|in|lk=on}}

  ERROR {{Convert}}: Use "m" (not "metre") as the unit code. Try:{{convert|1234.56789|m|in|...}}.
  For other unit codes, see: Template:Convert/list of units.  

1,234.56789 metres (48,605.035 in)
{{convert|1234.56789|milimetre|in|lk=on}} Template:Convert/milimetre 1,234.56789 milimetre[convert: unknown unit]
{{convert|1234.56789|millimetre|in|lk=on}} Template:Convert/millimetre 1,234.56789 millimetre[convert: unknown unit]
{{convert|1234.56789|micrometres|in|lk=on}} Template:Convert/micrometres 1,234.56789 micrometres[convert: unknown unit]
{{convert|1234.56789|micrometre|in|lk=on}} 1,234.56789 micrometres (0.048605035 in) 1,234.56789 micrometres (0.048605035 in) Exact Match


The prefixes

From module:convert/text:

-- The prefix field is what the prefix should be, if different from the prefix used.
   ['Y'] = { exponent = 24, name = 'yotta',                  },
   ['Z'] = { exponent = 21, name = 'zetta',                  },
   ['E'] = { exponent = 18, name = 'exa'  ,                  },
   ['P'] = { exponent = 15, name = 'peta' ,                  },
   ['T'] = { exponent = 12, name = 'tera' ,                  },
   ['G'] = { exponent =  9, name = 'giga' ,                  },
   ['M'] = { exponent =  6, name = 'mega' ,                  },
   ['k'] = { exponent =  3, name = 'kilo' ,                  },
   ['h'] = { exponent =  2, name = 'hecto',                  },
   ['da']= { exponent =  1, name = 'deca' , name_us = 'deka' },
   ['d'] = { exponent = -1, name = 'deci' ,                  },
   ['c'] = { exponent = -2, name = 'centi',                  },
   ['m'] = { exponent = -3, name = 'milli',                  },
   ['μ'] = { exponent = -6, name = 'micro', prefix = 'µ'     },  -- key = 'GREEK SMALL LETTER MU' (U+03BC) utf-8 CE BC
   ['µ'] = { exponent = -6, name = 'micro',                  },  -- key = 'MICRO SIGN' (U+00B5) utf-8 C2 B5
   ['u'] = { exponent = -6, name = 'micro', prefix = 'µ'     },  -- not an SI prefix, but allow for people typing this
   ['n'] = { exponent = -9, name = 'nano' ,                  },
   ['p'] = { exponent =-12, name = 'pico' ,                  },
   ['f'] = { exponent =-15, name = 'femto',                  },
   ['a'] = { exponent =-18, name = 'atto' ,                  },
   ['z'] = { exponent =-21, name = 'zepto',                  },
   ['y'] = { exponent =-24, name = 'yocto',                  },
}

Engineering notation

Engineering notation in {convert} looks like: e3m2. So it is added to the unit name (id) as a prefix, not the numerical part of the measure. See Help:Convert_units#Engineering_notation. The tests below are module:convert compared with {{convert/old}}.

  • {convert|123.4|e3m2}} → 123.4 thousand square metres (1.328×10^6 sq ft)
{convert/old|123.4|e3m2}} → 123.4 thousand square metres (1.328×10^6 sq ft)
  • {convert|123.4|e3m2|e6sqft|abbr=off}} → 123.4 thousand square metres (1.328 million square feet)
{convert/old|123.4|e3m2|e6sqft|abbr=off}} → Template:Convert/engout/sandbox (1.328 million square feet)
  • {convert|1.23|e6L}} → 1.23 million litres (320,000 US gal)
{convert/old|1.23|e6L}} → 1.23 million litres (320,000 US gal)
  • {convert|1.23|e6L|e3usgal|abbr=off|lk=on|sp=us}} → 1.23 million liters (320 thousand U.S. gallons)
{convert/old|1.23|e6L|e3usgal|abbr=off|lk=on|sp=us}} → Template:Convert/LonAnoneDbSoffEng
  • {convert|1.23|e9impgal}} → 1.23 billion imperial gallons (5.6 Gl)
{convert/old|1.23|e9impgal}} → 1.23 billion imperial gallons (5.6 Gl)
{convert/old|1.23|e9impgal|e3usgal|abbr=off|lk=on}} → Template:Convert/LonAnoneDbSoffEng
  • {convert|1.23|e12cuft}} → 1.23 trillion cubic feet (35×10^9 m3)
{convert/old|1.23|e12cuft}} → 1.23 trillion cubic feet (35×10^9 m3)