Module:Convert/text: Difference between revisions

SIprefixes table moved from Module:Convert/data to here for translation on another wiki; precision=3 no longer accepted
(minor tweak)
(SIprefixes table moved from Module:Convert/data to here for translation on another wiki; precision=3 no longer accepted)
Line 1:
--[[ Text used by Module:Convert.
 
This is a separate module to simplify translation iffor useduse on another wiki.
Module:Convert responds to text parameters, and can display text.
Nearly all that text is defined in:
Line 10:
parameters shown in the following examples:
debug=yes Can be used with sortable=on.
precision=3 Not needed because "3" means "precision=3".
sigfig=3 To set number of output significant figures.
]]
 
-- Some units accept an SI prefix before the unit code, such as "kg" for kilogram.
local SIprefixes = {
-- 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', },
}
 
-- Some units can be qualified with one of the following prefixes, when linked.
Line 205 ⟶ 231:
 
return {
SIprefixes = SIprefixes,
all_categories = all_categories,
all_messages = all_messages,
Anonymous user