Module:Val/units: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Johnuniq
include all units from Template:Val/units while removing items that were in Module:Val/units which duplicate or clash the template units
meta>Johnuniq
clean up duplicate/clashing unit definitions
Line 1: Line 1:
-- Definitions for units known to val (short scale; see below for long scale).
-- Definitions for units known to val (short scale; see below for long scale).
-- There must be two spaces (not tab characters) after each unit code, and
-- There must be two spaces (not tab characters) between columns.
-- two spaces or tabs between columns.
-- Lines which do not have two spaces are ignored.
-- There must be a blank line before the first unit and a newline after the last.
-- There must be a blank line before the first unit and after the last.
-- Unit code      Symbol                                Link                                  Flags
-- Unit code      Symbol                                Link                                  Flags
local builtin_units = [=[
local builtin_units = [=[
Line 51: Line 51:
year              year                                  Year
year              year                                  Year
years              years                                Year
years              years                                Year
yr                yr                                    Year#Symbols_y_and_yr
yr                yr                                    Year#Symbols y and yr
y                  y                                    Year
y                  y                                    Year
Ga                Ga                                    Gigaannum
Ga                Ga                                    Gigaannum
Line 59: Line 59:
kya                kya                                  Kyr
kya                kya                                  Kyr
myr                myr                                  Million years
myr                myr                                  Million years
mya                mya                                  Mya_(unit)
mya                mya                                  Mya (unit)
byr                byr                                  Billion years
byr                byr                                  Billion years
bya                bya                                  Billion years ago
bya                bya                                  Billion years ago
Gyr                Ga                                    Year#SI_prefix_multipliers
Gyr                Ga                                    Year#SI prefix multipliers
BP                BP                                    Before present
BP                BP                                    Before present
uBP                <sup>14</sup>C yr BP                  Radiocarbon dating#Calibration
uBP                <sup>14</sup>C yr BP                  Radiocarbon dating#Calibration
Line 221: Line 221:
g/cm3              g/cm<sup>3</sup>                      Gram per cubic centimetre
g/cm3              g/cm<sup>3</sup>                      Gram per cubic centimetre
kg/m3              kg/m<sup>3</sup>                      Kilogram per cubic metre
kg/m3              kg/m<sup>3</sup>                      Kilogram per cubic metre
kg/cm3            kg/cm<sup>3</sup>                    Density#Formula_and_common_units
kg/cm3            kg/cm<sup>3</sup>                    Density#Formula and common units
g/L                g/L                                  Gram per litre
g/L                g/L                                  Gram per litre
g/l                g/L                                  Gram per litre
g/l                g/L                                  Gram per litre
Line 266: Line 266:
Wb                Wb                                    Weber (unit)
Wb                Wb                                    Weber (unit)
N.A-2              N&sdot;A<sup>−2</sup>                Permeability (electromagnetism)
N.A-2              N&sdot;A<sup>−2</sup>                Permeability (electromagnetism)
H.m-1              H·m<sup>−1</sup>                      Permeability_(electromagnetism)
H.m-1              H·m<sup>−1</sup>                      Permeability (electromagnetism)
V/m                V/m                                  Electric field
V/m                V/m                                  Electric field
V.m-1              V&sdot;m<sup>−1</sup>                Electric field
V.m-1              V&sdot;m<sup>−1</sup>                Electric field
Line 371: Line 371:
R_Earth            ''R''<sub>⊕</sub>                    Earth radius
R_Earth            ''R''<sub>⊕</sub>                    Earth radius
Jupiter mass      ''M''<sub>J</sub>                    Jupiter mass
Jupiter mass      ''M''<sub>J</sub>                    Jupiter mass
Jupiter radius    R<sub>J</sub>                         Jupiter radius
Jupiter radius    ''R''<sub>J</sub>                     Jupiter radius
M_Jupiter          ''M''<sub>J</sub>                    Jupiter mass
M_Jupiter          ''M''<sub>J</sub>                    Jupiter mass
R_Jupiter          ''R''<sub>J</sub>                    Jupiter radius
R_Jupiter          ''R''<sub>J</sub>                    Jupiter radius
Line 388: Line 388:
pc2                pc<sup>2</sup>                        Parsec
pc2                pc<sup>2</sup>                        Parsec
pc3                pc<sup>3</sup>                        Parsec
pc3                pc<sup>3</sup>                        Parsec
kpc2              kpc<sup>2</sup>                      Parsec#Parsecs_and_kiloparsecs
kpc2              kpc<sup>2</sup>                      Parsec#Parsecs and kiloparsecs
kpc3              kpc<sup>3</sup>                      Parsec#Parsecs_and_kiloparsecs
kpc3              kpc<sup>3</sup>                      Parsec#Parsecs and kiloparsecs
kpc                kpc                                  Parsec#Parsecs_and_kiloparsecs
kpc                kpc                                  Parsec#Parsecs and kiloparsecs
Mpc2              Mpc<sup>2</sup>                      Parsec#Megaparsecs_and_gigaparsecs
Mpc2              Mpc<sup>2</sup>                      Parsec#Megaparsecs and gigaparsecs
Mpc3              Mpc<sup>3</sup>                      Parsec#Megaparsecs_and_gigaparsecs
Mpc3              Mpc<sup>3</sup>                      Parsec#Megaparsecs and gigaparsecs
Mpc                Mpc                                  Parsec#Megaparsecs_and_gigaparsecs
Mpc                Mpc                                  Parsec#Megaparsecs and gigaparsecs
Gpc2              Gpc<sup>2</sup>                      Parsec#Megaparsecs_and_gigaparsecs
Gpc2              Gpc<sup>2</sup>                      Parsec#Megaparsecs and gigaparsecs
Gpc3              Gpc<sup>3</sup>                      Parsec#Megaparsecs_and_gigaparsecs
Gpc3              Gpc<sup>3</sup>                      Parsec#Megaparsecs and gigaparsecs
Gpc                Gpc                                  Parsec#Megaparsecs_and_gigaparsecs
Gpc                Gpc                                  Parsec#Megaparsecs and gigaparsecs


== Nuclear Physics and Chemistry ==
== Nuclear Physics and Chemistry ==
Line 473: Line 473:
trillionths        trillionths                          Orders of magnitude (numbers)#1012
trillionths        trillionths                          Orders of magnitude (numbers)#1012


== From original Module:Val/units after removing items which duplicate/clash with Template:Val/units. TODO: CHECK ==
== Extra items from Module:Val/units. TODO: Check if these are wanted ==
μN                µ<sub>N</sub>                        nuclear magneton
g*mol-1            g&sdot;mol<sup>&minus;1</sup>        molar mass
GJ*mol-1          GJ&sdot;mol<sup>&minus;1</sup>        joule per mole
H*m-1              H                                    Henry (unit)
J*mol-1            J&sdot;mol<sup>&minus;1</sup>        joule per mole
J*s                J&sdot;s                              joule-second
Js                J&sdot;s                              joule-second
kJ*mol-1          kJ&sdot;mol<sup>&minus;1</sup>        joule per mole
m*s-1              m&sdot;s<sup>&minus;1</sup>          metre per second
m*s-2              m&sdot;s<sup>&minus;2</sup>          metre per second squared
m2                m<sup>2</sup>                        Square metre
m2                m<sup>2</sup>                        Square metre
m3                m<sup>3</sup>                        Cubic metre
m3                m<sup>3</sup>                        Cubic metre
MJ*mol-1           MJ&sdot;mol<sup>&minus;1</sup>       joule per mole
m*s-1             m&sdot;s<sup>−1</sup>                 Metre per second
N*A-2             N&sdot;A<sup>&minus;2</sup>          permeability (electromagnetism)
m*s-2              m&sdot;s<sup>−2</sup>                 Metre per second squared
N*m-1              N&sdot;m<sup>&minus;1</sup>           joule (unit)
N*m-1             N&sdot;m<sup>−1</sup>                Joule (unit)
second            s                                    second
GJ*mol-1          GJ&sdot;mol<sup>−1</sup>             Joule per mole
seconds            s                                    second
J*mol-1            J&sdot;mol<sup>−1</sup>               Joule per mole
TJ*mol-1           TJ&sdot;mol<sup>&minus;1</sup>       joule per mole
kJ*mol-1           kJ&sdot;mol<sup>−1</sup>              Joule per mole
MJ*mol-1           MJ&sdot;mol<sup>−1</sup>             Joule per mole
TJ*mol-1          TJ&sdot;mol<sup>−1</sup>              Joule per mole
J*s                J&sdot;s                              Joule-second
Js                J&sdot;s                              Joule-second
μN                µ<sub>N</sub>                        Nuclear magneton
g*mol-1           g&sdot;mol<sup>−1</sup>               Molar mass
second            s                                    Second
seconds            s                                    Second
USgal              US gal                                US gallon
H*m-1             H                                    Henry (unit)
N*A-2              N&sdot;A<sup>−2</sup>                 Permeability (electromagnetism)
torr              Torr                                  Torr
torr              Torr                                  Torr
USgal              US gal                                US gallon
V*m-1              V&sdot;m<sup>−1</sup>                 Electric field
V*m-1              V&sdot;m<sup>&minus;1</sup>           electric field
Vm-1              V&sdot;m<sup>−1</sup>                 Electric field
Vm-1              V&sdot;m<sup>&minus;1</sup>           electric field
W                  W                                    Watt
W                  W                                    Watt


Line 535: Line 535:
]=]
]=]


-- Duplicate/clash items removed from original Module:Val/units.
-- Items from Module:Val/units which have different definitions from those above.
-- TODO Check whether removing these is desirable.
-- TODO: Are any of these needed? Can they be deleted?
local removed_units = [=[
local removed_units = [=[


µA                µA                                    microampere
µA                µA                                    microampere
µB                 µ<sub>B</sub>                        Bohr magneton
aA                 aA                                    attoampere
µG                 µG                                   microgauss
cA                 cA                                   centiampere
µGal              µGal                                  Gal (unit)
daA               daA                                   decaampere
µHz               µHz                                   hertz
fA                fA                                    femtoampere
µK                 µK                                   microkelvin
GA                GA                                    gigaampere
µN                 µ<sub>N</sub>                        nuclear magneton
hA                hA                                    hectoampere
µT                 µT                                   microtesla
kA                 kA                                   kiloampere
MA                 MA                                    megaampere
mA                 mA                                   milliampere
µV                µV                                    microvolt
µV                µV                                    microvolt
μg/dL              μg/dL                                gram per litre
fV                 fV                                   femtovolt
μg/dl              μg/dL                                gram per litre
GV                 GV                                   gigavolt
A                  A                                    ampere
kV                 kV                                   kilovolt
aA                aA                                    attoampere
AD                 AD                                   Anno Domini
aG                 aG                                   attogauss
ag                 ag                                   attogram
aHz                aHz                                  attohertz
aHz                aHz                                  attohertz
aK                aK                                    attokelvin
am                am                                    attometre
aT                aT                                    attotesla
BC                BC                                    Before Christ
BCE                BCE                                  Before the Common Era
bit/s              bit/s                                bit per second
BP                BP                                    Before present
bps                bit/s                                bit per second
bya                bya                                  billion years ago
byr                byr                                  billion years
c                  <i>c</i>                              speed of light
C                  C                                    coulomb
cA                cA                                    centiampere
CE                CE                                    Common Era
cG                cG                                    centigauss
cg                cg                                    centigram
cHz                cHz                                  centihertz
cHz                cHz                                  centihertz
cK                cK                                    centikelvin
cm-1              cm<sup>&minus;1</sup>                wavenumber
cT                cT                                    centitesla
cV                cV                                    volt
dA                dA                                    ampere
daA                daA                                  decaampere
daG                daG                                  decagauss
dag                dag                                  decagram
daHz              daHz                                  decahertz
daHz              daHz                                  decahertz
daK                daK                                  decakelvin
daT                daT                                  decatesla
daV                daV                                  volt
degC              °C                                    degree Celsius
degF              °F                                    Fahrenheit
degR              °R                                    Rankine scale
dG                dG                                    decigauss
dg                dg                                    decigram
dHz                dHz                                  hertz
dK                dK                                    decikelvin
dT                dT                                    decitesla
dV                dV                                    volt
e                  <i>e</i>                              Elementary charge
EA                EA                                    ampere
Earth mass        <i>M</i><sub>⊕</sub>                  Earth mass
Earth radius      <i>R</i><sub>⊕</sub>                  Earth radius
EG                EG                                    exagauss
Eg                Eg                                    exagram
EHz                EHz                                  exahertz
EHz                EHz                                  exahertz
EK                EK                                    exakelvin
ET                ET                                    exatesla
EV                EV                                    volt
eV/c2              eV/<i>c</i><sup>2</sup>              electronvolt#Mass
F                  F                                    farad
fA                fA                                    femtoampere
fb-1              fb<sup>&minus;1</sup>                Barn (unit)
fG                fG                                    femtogauss
fg                fg                                    femtogram
fHz                fHz                                  femtohertz
fHz                fHz                                  femtohertz
fK                fK                                    femtokelvin
hHz                hHz                                  hectohertz
fT                fT                                    femtotesla
PHz                PHz                                  petahertz
fV                fV                                    femtovolt
THz               THz                                   terahertz
g/cm3              g/cm<sup>3</sup>                      gram per cubic centimetre
YHz               YHz                                   yottahertz
g/l               g/l                                   gram per litre
am                am                                    attometre
g/L               g/L                                   gram per litre
ym                 ym                                   yoctometre
g/mol              g&sdot;mol<sup>&minus;1</sup>        molar mass
zm                 zm                                   zeptometre
GA                 GA                                   gigaampere
dag               dag                                   decagram
Ga                 Ga                                   gigaannum
Tg                 Tg                                   teragram
gal               gal                                   gallon
Gyr                Ga                                   gigaannum
Gbit/s            Gbit/s                                gigabit per second
mya               mya                                   million years ago
GeV/c2            GeV/<i>c</i><sup>2</sup>              electronvolt#Mass
degC              °C                                   degree Celsius
GG                 GG                                   gigagauss
Gg                Gg                                   gigagram
GHz               GHz                                   gigahertz
GJ/mol            GJ/mol                                joule per mole
GK                GK                                   gigakelvin
GPa                GPa                                  gigapascal
GPa                GPa                                  gigapascal
kg/cm3            kg/cm<sup>3</sup>                    density#Formula and common units
µB                µ<sub>B</sub>                        Bohr magneton
µN                µ<sub>N</sub>                        nuclear magneton
g/mol              g&sdot;mol<sup>−1</sup>              molar mass
kg/mol            kg&sdot;mol<sup>−1</sup>              molar mass
Gpc                Gpc                                  megaparsec#Megaparsecs and gigaparsecs
Gpc                Gpc                                  megaparsec#Megaparsecs and gigaparsecs
Gpc2              Gpc<sup>2</sup>                      megaparsec#Megaparsecs and gigaparsecs
Gpc2              Gpc<sup>2</sup>                      megaparsec#Megaparsecs and gigaparsecs
Gpc3              Gpc<sup>3</sup>                      megaparsec#Megaparsecs and gigaparsecs
Gpc3              Gpc<sup>3</sup>                      megaparsec#Megaparsecs and gigaparsecs
GT                GT                                    gigatesla
GV                GV                                    gigavolt
Gyr                Ga                                    gigaannum
H                  H                                    Henry (unit)
hA                hA                                    hectoampere
hG                hG                                    hectogauss
hg                hg                                    hectogram
hHz                hHz                                  hectohertz
hK                hK                                    hectokelvin
hT                hT                                    hectotesla
hV                hV                                    volt
Hz                Hz                                    hertz
J/kg              J/kg                                  joule
J/mol              J/mol                                joule per mole
Jupiter mass      <i>M</i><sub>J</sub>                  Jupiter mass
Jupiter radius    <i>R</i><sub>J</sub>                  Jupiter radius
kA                kA                                    kiloampere
ka                ka                                    kiloannum
kbit/s            kbit/s                                kilobit per second
keV/c2            keV/<i>c</i><sup>2</sup>              electronvolt#Mass
kG                kG                                    kilogauss
kg/cm3            kg/cm<sup>3</sup>                    density#Formula and common units
kg/m3              kg/m<sup>3</sup>                      kilogram per cubic metre
kg/mol            kg&sdot;mol<sup>&minus;1</sup>        molar mass
kHz                kHz                                  Kilohertz
kJ/mol            kJ/mol                                joule per mole
kK                kK                                    kilokelvin
KPa                kPa                                  pascal (unit)
kpc                kpc                                  kiloparsec
kpc                kpc                                  kiloparsec
kpc2              kpc<sup>2</sup>                      kiloparsec
kpc2              kpc<sup>2</sup>                      kiloparsec
kpc3              kpc<sup>3</sup>                      kiloparsec
kpc3              kpc<sup>3</sup>                      kiloparsec
kT                kT                                    kilotesla
kV                kV                                    kilovolt
kW.h              kW&sdot;h                            kilowatt hour
kWh                kWh                                  kilowatt hour
kW·h              kW&sdot;h                            kilowatt hour
kya                kya                                  kyr
kyr                kyr                                  kyr
L_solar            <i>L</i><sub>&#x2609;</sub>          solar luminosity
ly                ly                                    light-year
m                  m                                    metre
m-1                m<sup>&minus;1</sup>                  metre
m-2                m<sup>&minus;2</sup>                  square metre
m-3                m<sup>&minus;3</sup>                  cubic metre
M_Earth            <i>M</i><sub>⊕</sub>                  Earth mass
M_Jupiter          <i>M</i><sub>J</sub>                  Jupiter mass
M_solar            <i>M</i><sub>&#x2609;</sub>          solar mass
M_Solar            <i>M</i><sub>&#x2609;</sub>          solar mass
MA                MA                                    megaampere
Ma                Ma                                    megaannum
mA                mA                                    milliampere
Mbit/s            Mbit/s                                megabit per second
mcg                µg                                    microgram
mcg/dL            µg/dL                                gram per
mcg/dl            µg/dl                                gram per
meter              m                                    metre
metre              m                                    metre
MeV/c2            MeV/<i>c</i><sup>2</sup>              electronvolt#Mass
MG                MG                                    megagauss
Mg                Mg                                    megagram
mG                mG                                    milligauss
mg/ml              mg/mL                                gram per litre
mg/mL              mg/mL                                gram per litre
mHz                mHz                                  hertz
MHz                MHz                                  megahertz
MJ/mol            MJ/mol                                joule per mole
MK                MK                                    megakelvin
mK                mK                                    millikelvin
Mpc                Mpc                                  parsec#Megaparsecs and gigaparsecs
Mpc                Mpc                                  parsec#Megaparsecs and gigaparsecs
Mpc2              Mpc<sup>2</sup>                      parsec#Megaparsecs and gigaparsecs
Mpc2              Mpc<sup>2</sup>                      parsec#Megaparsecs and gigaparsecs
Mpc3              Mpc<sup>3</sup>                      parsec#Megaparsecs and gigaparsecs
Mpc3              Mpc<sup>3</sup>                      parsec#Megaparsecs and gigaparsecs
MT                MT                                    megatesla
mT                mT                                    millitesla
muA                µA                                    ampere
muG                µG                                    microgauss
mug                µg                                    microgram
muGal              µGal                                  Gal (unit)
muHz              µHz                                  hertz
muJ                µJ                                    joule
muK                µK                                    microkelvin
mum                µm                                    micrometre
mus                µs                                    microsecond
muT                µT                                    microtesla
muV                µV                                    volt
MV                MV                                    volt
mV                mV                                    volt
mya                mya                                  million years ago
myr                myr                                  million years
nA                nA                                    ampere
nG                nG                                    nanogauss
ng                ng                                    nanogram
nHz                nHz                                  hertz
nK                nK                                    nanokelvin
nT                nT                                    nanotesla
nV                nV                                    volt
pA                pA                                    ampere
PA                PA                                    ampere
pc2                pc<sup>2</sup>                        Parsec
pc3                pc<sup>3</sup>                        Parsec
PG                PG                                    petagauss
Pg                Pg                                    petagram
pG                pG                                    picogauss
pg                pg                                    picogram
pHz                pHz                                  hertz
PHz                PHz                                  petahertz
PK                PK                                    petakelvin
pK                pK                                    picokelvin
ppb                ppb                                  parts per billion
ppm                ppm                                  parts per million
PT                PT                                    petatesla
pT                pT                                    picotesla
PV                PV                                    volt
pV                pV                                    volt
R                  R                                    rayleigh (unit)
R_Earth            <i>R</i><sub>⊕</sub>                  Earth radius
R_Jupiter          <i>R</i><sub>J</sub>                  Jupiter radius
R_solar            <i>R</i><sub>&#x2609;</sub>          solar radius
R_Solar            <i>R</i><sub>&#x2609;</sub>          solar radius
s                  s                                    second
s-1                s<sup>&minus;1</sup>                  second
s-2                s<sup>&minus;2</sup>                  second
s2                s<sup>2</sup>                        second
solar luminosity  <i>L</i><sub>&#x2609;</sub>          solar luminosity
Solar luminosity  <i>L</i><sub>&#x2609;</sub>          solar luminosity
solar mass        <i>M</i><sub>&#x2609;</sub>          solar mass
Solar mass        <i>M</i><sub>&#x2609;</sub>          solar mass
solar radius      <i>R</i><sub>&#x2609;</sub>          solar radius
Solar radius      <i>R</i><sub>&#x2609;</sub>          solar radius
TA                TA                                    ampere
Tbit/s            Tbit/s                                terabit per second
TeV/c2            TeV/<i>c</i><sup>2</sup>              electronvolt#Mass
TG                TG                                    teragauss
Tg                Tg                                    teragram
THz                THz                                  terahertz
TJ/mol            TJ/mol                                joule per mole
TK                TK                                    terakelvin
Torr              Torr                                  Torr
TT                TT                                    teratesla
TV                TV                                    volt
u                  u                                    atomic mass unit
uBP                <sup>14</sup>C yr BP                  Radiocarbon dating#Calibration
V                  V                                    volt
V/m                V/m                                  electric field
VV                VV                                    volt
Wb                Wb                                    Weber (unit)
y                  y                                    year
YA                YA                                    ampere
yA                yA                                    ampere
year              year                                  year
years              years                                year
yG                yG                                    yoctogauss
yg                yg                                    yoctogram
YG                YG                                    yottagauss
Yg                Yg                                    yottagram
yHz                yHz                                  hertz
YHz                YHz                                  yottahertz
yK                yK                                    yoctokelvin
YK                YK                                    yottakelvin
ym                ym                                    yoctometre
yr                yr                                    year#Symbols y and yr
yT                yT                                    yoctotesla
YT                YT                                    Yottatesla
YV                YV                                    volt
yV                yV                                    volt
ZA                ZA                                    ampere
zA                zA                                    ampere
zG                zG                                    zeptogauss
zg                zg                                    zeptogram
ZG                ZG                                    zettagauss
Zg                Zg                                    zettagram
zHz                zHz                                  hertz
ZHz                ZHz                                  hertz
zK                zK                                    zeptokelvin
ZK                ZK                                    zettakelvin
zm                zm                                    zeptometre
zT                zT                                    zeptotesla
ZT                ZT                                    zettatesla
zV                zV                                    volt
ZV                ZV                                    volt


]=]
]=]

Revision as of 01:30, 8 July 2015

Documentation for this module may be created at Module:Val/units/doc

-- Definitions for units known to val (short scale; see below for long scale).
-- There must be two spaces (not tab characters) between columns.
-- Lines which do not have two spaces are ignored.
-- There must be a blank line before the first unit and after the last.
-- Unit code       Symbol                                Link                                   Flags
local builtin_units = [=[

== Angles ==
%                  %                                     percent                                NOSPACE
percent            %                                     percent                                NOSPACE
per cent           %                                     percent                                NOSPACE
‰                  ‰                                     per mil                                NOSPACE
per mil            ‰                                     per mil                                NOSPACE
per mill           ‰                                     per mil                                NOSPACE
per mille          ‰                                     per mil                                NOSPACE
permil             ‰                                     per mil                                NOSPACE
permill            ‰                                     per mil                                NOSPACE
permille           ‰                                     per mil                                NOSPACE
°                  °                                     degree (angle)                         NOSPACE
deg                °                                     degree (angle)                         NOSPACE
'                  ′                                     minute of arc                          NOSPACE
′                  ′                                     minute of arc                          NOSPACE
arcmin             ′                                     minute of arc                          NOSPACE
arcminute          ′                                     minute of arc                          NOSPACE
"                  ″                                     second of arc                          NOSPACE
″                  ″                                     second of arc                          NOSPACE
arcsec             ″                                     second of arc                          NOSPACE
arcsecond          ″                                     second of arc                          NOSPACE

== Unsorted units ==
Torr               Torr                                  Torr
lbf                <span title="pound-force">lb<sub>F</sub></span>   Pound (force)
Foo                Foo                                   Foo
C/mol              C/mol                                 Faraday constant
C.mol-1            C&sdot;mol<sup>−1</sup>               Faraday constant
C/kg               C/kg                                  Roentgen (unit)
C.kg-1             C&sdot;kg<sup>−1</sup>                Roentgen (unit)
F.m-1              F&sdot;m<sup>−1</sup>                 vacuum permittivity
F/m                F/m                                   vacuum permittivity
e                  ''e''                                 Elementary charge

== Time and frequency ==
byte               byte                                  Byte
byte/s             byte/s                                Bytes per second
bit/s              bit/s                                 Bit per second
bps                bit/s                                 Bit per second
kbit/s             kbit/s                                Kilobit per second
Mbit/s             Mbit/s                                Megabit per second
Gbit/s             Gbit/s                                Gigabit per second
Tbit/s             Tbit/s                                Terabit per second
year               year                                  Year
years              years                                 Year
yr                 yr                                    Year#Symbols y and yr
y                  y                                     Year
Ga                 Ga                                    Gigaannum
Ma                 Ma                                    Megaannum
ka                 ka                                    Kiloannum
kyr                kyr                                   Kyr
kya                kya                                   Kyr
myr                myr                                   Million years
mya                mya                                   Mya (unit)
byr                byr                                   Billion years
bya                bya                                   Billion years ago
Gyr                Ga                                    Year#SI prefix multipliers
BP                 BP                                    Before present
uBP                <sup>14</sup>C yr BP                  Radiocarbon dating#Calibration
s-1                s<sup>−1</sup>                        Second
s-2                s<sup>−2</sup>                        Second
s2                 s<sup>2</sup>                         Second
s                  s                                     Second
as                 as                                    Attosecond
cs                 cs                                    Second
das                das                                   Second
ds                 ds                                    Second
Es                 Es                                    Second
fs                 fs                                    Femtosecond
Gs                 Gs                                    Second
hs                 hs                                    Second
ks                 ks                                    Second
ms                 ms                                    Millisecond
µs                 µs                                    Microsecond
mus                µs                                    Microsecond
Ms                 Ms                                    Second
ns                 ns                                    Nanosecond
ps                 ps                                    Picosecond
Ps                 Ps                                    Second
Ts                 Ts                                    Second
Ys                 Ys                                    Second
ys                 ys                                    Yoctosecond
Zs                 Zs                                    Second
zs                 zs                                    Zeptosecond
Hz                 Hz                                    Hertz
aHz                aHz                                   Hertz
cHz                cHz                                   Hertz
daHz               daHz                                  Hertz
dHz                dHz                                   Hertz
EHz                EHz                                   Hertz
fHz                fHz                                   Hertz
hHz                hHz                                   Hertz
GHz                GHz                                   Gigahertz
kHz                kHz                                   Kilohertz
MHz                MHz                                   Megahertz
mHz                mHz                                   Hertz
muHz               µHz                                   Hertz
µHz                µHz                                   Hertz
nHz                nHz                                   Hertz
pHz                pHz                                   Hertz
PHz                PHz                                   Hertz
THz                THz                                   Hertz
yHz                yHz                                   Hertz
YHz                YHz                                   Hertz
zHz                zHz                                   Hertz
ZHz                ZHz                                   Hertz
BC                 BC                                    Before Christ
AD                 AD                                    Anno Domini
BCE                BCE                                   Before the Common Era
CE                 CE                                    Common Era

== Length, area, volume ==
fb-1               fb<sup>−1</sup>                       Barn (unit)
mas                mas                                   Milliarcsecond
m-1                m<sup>−1</sup>                        Metre
m-2                m<sup>−2</sup>                        Square metre
m-3                m<sup>−3</sup>                        Cubic metre
km2                km<sup>2</sup>                        Square kilometre
km3                km<sup>3</sup>                        Square kilometre
m                  m                                     Metre
meter              m                                     Metre
metre              m                                     Metre
am                 am                                    Metre
cm                 cm                                    Centimetre
dam                dam                                   Decametre
dm                 dm                                    Decimetre
Em                 Em                                    Metre
fm                 fm                                    Metre
Gm                 Gm                                    Metre
hm                 hm                                    Hectometre
km                 km                                    Kilometre
Mm                 Mm                                    Megametre
mm                 mm                                    Millimetre
mum                µm                                    Micrometre
µm                 µm                                    Micrometre
nm                 nm                                    Nanometre
Pm                 Pm                                    Metre
pm                 pm                                    Picometre
Tm                 Tm                                    Metre
Ym                 Ym                                    Metre
ym                 ym                                    Metre
Zm                 Zm                                    Metre
zm                 zm                                    Metre
µm2                µm<sup>2</sup>                        Square metre
am2                am<sup>2</sup>                        Square metre
cm2                cm<sup>2</sup>                        Square centimetre
dam2               dam<sup>2</sup>                       Square metre
dm2                dm<sup>2</sup>                        Square metre
Em2                Em<sup>2</sup>                        Square metre
fm2                fm<sup>2</sup>                        Square metre
Gm2                Gm<sup>2</sup>                        Square metre
hm2                hm<sup>2</sup>                        Square metre
mm2                mm<sup>2</sup>                        Square metre
Mm2                Mm<sup>2</sup>                        Square metre
nm2                nm<sup>2</sup>                        Square metre
pm2                pm<sup>2</sup>                        Square metre
Pm2                Pm<sup>2</sup>                        Square metre
Tm2                Tm<sup>2</sup>                        Square metre
ym2                ym<sup>2</sup>                        Square metre
Ym2                Ym<sup>2</sup>                        Square metre
zm2                zm<sup>2</sup>                        Square metre
Zm2                Zm<sup>2</sup>                        Square metre
gal                gal                                   Gallon
Gal                Gal                                   Gal (unit)
muGal              µGal                                  Gal (unit)
µGal               µGal                                  Gal (unit)
mGal               mGal                                  Gal (unit)

== Velocity and acceleration ==
m/s2               m/s<sup>2</sup>                       Metre per second squared
m.s-2              m&sdot;s<sup>−2</sup>                 Metre per second squared
m/s                m/s                                   Metre per second
m.s-1              m&sdot;s<sup>−1</sup>                 Metre per second

== Mass and energy ==
lbm                <span title="pound-mass">lb<sub>m</sub></span>   Pound (mass)
muJ                µJ                                    Joule
J.s                J&sdot;s                              Joule-second
kWh                kWh                                   Kilowatt hour
kW.h               kW&sdot;h                             Kilowatt hour
kW·h               kW&sdot;h                             Kilowatt hour
J/C                J/C                                   Volt
J/kg               J/kg                                  Joule
g                  g                                     Gram
ag                 ag                                    Attogram
cg                 cg                                    Centigram
dag                dag                                   Gram
dg                 dg                                    Decigram
Eg                 Eg                                    Exagram
fg                 fg                                    Femtogram
Gg                 Gg                                    Gigagram
hg                 hg                                    Hectogram
kg                 kg                                    Kilogram
mcg                µg                                    Microgram
Mg                 Mg                                    Megagram
mg                 mg                                    Milligram
mug                µg                                    Microgram
µg                 µg                                    Microgram
ng                 ng                                    Nanogram
Pg                 Pg                                    Petagram
pg                 pg                                    Picogram
Tg                 Tg                                    Tonne
yg                 yg                                    Yoctogram
Yg                 Yg                                    Yottagram
zg                 zg                                    Zeptogram
Zg                 Zg                                    Zettagram

== Pressure and density ==
Pa                 Pa                                    Pascal (unit)
MPa                MPa                                   Pascal (unit)
KPa                KPa                                   Pascal (unit)
GPa                GPa                                   Pascal (unit)
psi                psi                                   Pounds per square inch
g/cm3              g/cm<sup>3</sup>                      Gram per cubic centimetre
kg/m3              kg/m<sup>3</sup>                      Kilogram per cubic metre
kg/cm3             kg/cm<sup>3</sup>                     Density#Formula and common units
g/L                g/L                                   Gram per litre
g/l                g/L                                   Gram per litre
mcg/dL             µg/dL                                 Gram per litre
mcg/dl             µg/dL                                 Gram per litre
mg/mL              mg/mL                                 Gram per litre
mg/ml              mg/mL                                 Gram per litre
mug/dL             µg/dL                                 Gram per litre
mug/dl             µg/dL                                 Gram per litre
μg/dL              μg/dL                                 Gram per litre
μg/dl              μg/dL                                 Gram per litre

== Temperature ==
°C                 °C                                    Celsius
degC               °C                                    Celsius
°F                 °F                                    Fahrenheit
degF               °F                                    Fahrenheit
°R                 °R                                    Rankine scale
degR               °R                                    Rankine scale
K                  K                                     Kelvin
aK                 aK                                    Attokelvin
cK                 cK                                    Centikelvin
daK                daK                                   Decakelvin
dK                 dK                                    Decikelvin
EK                 EK                                    Exakelvin
fK                 fK                                    Femtokelvin
GK                 GK                                    Gigakelvin
hK                 hK                                    Hectokelvin
kK                 kK                                    Kilokelvin
MK                 MK                                    Megakelvin
mK                 mK                                    Millikelvin
muK                µK                                    Microkelvin
µK                 µK                                    Microkelvin
nK                 nK                                    Nanokelvin
PK                 PK                                    Petakelvin
pK                 pK                                    Picokelvin
TK                 TK                                    Terakelvin
yK                 yK                                    Yoctokelvin
YK                 YK                                    Yottakelvin
zK                 zK                                    Zeptokelvin
ZK                 ZK                                    Zettakelvin

== Electromagnetism ==
Wb                 Wb                                    Weber (unit)
N.A-2              N&sdot;A<sup>−2</sup>                 Permeability (electromagnetism)
H.m-1              H·m<sup>−1</sup>                      Permeability (electromagnetism)
V/m                V/m                                   Electric field
V.m-1              V&sdot;m<sup>−1</sup>                 Electric field
C                  C                                     Coulomb
F                  F                                     Farad
H                  H                                     Henry (unit)
R                  R                                     Rayleigh (unit)
A                  A                                     Ampere
aA                 aA                                    Ampere
cA                 cA                                    Ampere
dA                 dA                                    Ampere
daA                daA                                   Ampere
EA                 EA                                    Ampere
fA                 fA                                    Ampere
GA                 GA                                    Ampere
hA                 hA                                    Ampere
kA                 kA                                    Ampere
mA                 mA                                    Ampere
MA                 MA                                    Ampere
muA                µA                                    Ampere
µA                 µA                                    Ampere
nA                 nA                                    Ampere
pA                 pA                                    Ampere
PA                 PA                                    Ampere
TA                 TA                                    Ampere
yA                 yA                                    Ampere
YA                 YA                                    Ampere
zA                 zA                                    Ampere
ZA                 ZA                                    Ampere
V                  V                                     Volt
cV                 cV                                    Volt
daV                daV                                   Volt
dV                 dV                                    Volt
EV                 EV                                    Volt
fV                 fV                                    Volt
GV                 GV                                    Volt
hV                 hV                                    Volt
kV                 kV                                    Volt
muV                µV                                    Volt
µV                 µV                                    Volt
mV                 mV                                    Volt
MV                 MV                                    Volt
nV                 nV                                    Volt
pV                 pV                                    Volt
PV                 PV                                    Volt
TV                 TV                                    Volt
VV                 VV                                    Volt
yV                 yV                                    Volt
YV                 YV                                    Volt
zV                 zV                                    Volt
ZV                 ZV                                    Volt
G                  G                                     Gauss (unit)
aG                 aG                                    Attogauss
cG                 cG                                    Centigauss
daG                daG                                   Decagauss
dG                 dG                                    Decigauss
EG                 EG                                    Exagauss
fG                 fG                                    Femtogauss
GG                 GG                                    Gigagauss
hG                 hG                                    Hectogauss
kG                 kG                                    Kilogauss
MG                 MG                                    Megagauss
mG                 mG                                    Milligauss
muG                µG                                    Microgauss
µG                 µG                                    Microgauss
nG                 nG                                    Nanogauss
PG                 PG                                    Petagauss
pG                 pG                                    Picogauss
TG                 TG                                    Teragauss
yG                 yG                                    Yoctogauss
YG                 YG                                    Yottagauss
zG                 zG                                    Zeptogauss
ZG                 ZG                                    Zettagauss
T                  T                                     Tesla (unit)
aT                 aT                                    Attotesla
cT                 cT                                    Centitesla
daT                daT                                   Decatesla
dT                 dT                                    Decitesla
ET                 ET                                    Exatesla
fT                 fT                                    Femtotesla
GT                 GT                                    Gigatesla
hT                 hT                                    Hectotesla
kT                 kT                                    Kilotesla
MT                 MT                                    Megatesla
mT                 mT                                    Millitesla
muT                µT                                    Microtesla
µT                 µT                                    Microtesla
nT                 nT                                    Nanotesla
PT                 PT                                    Petatesla
pT                 pT                                    Picotesla
TT                 TT                                    Teratesla
yT                 yT                                    Yoctotesla
YT                 YT                                    Yottatesla
zT                 zT                                    Zeptotesla
ZT                 ZT                                    Zettatesla

== Astrophysics ==
au                 au                                    Astronomical unit
c                  ''c''                                 Speed of light
ly                 ly                                    Light-year
Earth mass         ''M''<sub>⊕</sub>                     Earth mass
Earth radius       ''R''<sub>⊕</sub>                     Earth radius
M_Earth            ''M''<sub>⊕</sub>                     Earth mass
R_Earth            ''R''<sub>⊕</sub>                     Earth radius
Jupiter mass       ''M''<sub>J</sub>                     Jupiter mass
Jupiter radius     ''R''<sub>J</sub>                     Jupiter radius
M_Jupiter          ''M''<sub>J</sub>                     Jupiter mass
R_Jupiter          ''R''<sub>J</sub>                     Jupiter radius
Solar mass         ''M''<sub>&#x2609;</sub>              Solar mass
solar mass         ''M''<sub>&#x2609;</sub>              Solar mass
M_Solar            ''M''<sub>&#x2609;</sub>              Solar mass
M_solar            ''M''<sub>&#x2609;</sub>              Solar mass
R_Solar            ''R''<sub>&#x2609;</sub>              Solar radius
R_solar            ''R''<sub>&#x2609;</sub>              Solar radius
Solar radius       ''R''<sub>&#x2609;</sub>              Solar radius
solar radius       ''R''<sub>&#x2609;</sub>              Solar radius
Solar luminosity   ''L''<sub>&#x2609;</sub>              Solar luminosity
solar luminosity   ''L''<sub>&#x2609;</sub>              Solar luminosity
L_solar            ''L''<sub>&#x2609;</sub>              Solar luminosity
L_Solar            ''L''<sub>&#x2609;</sub>              Solar luminosity
pc2                pc<sup>2</sup>                        Parsec
pc3                pc<sup>3</sup>                        Parsec
kpc2               kpc<sup>2</sup>                       Parsec#Parsecs and kiloparsecs
kpc3               kpc<sup>3</sup>                       Parsec#Parsecs and kiloparsecs
kpc                kpc                                   Parsec#Parsecs and kiloparsecs
Mpc2               Mpc<sup>2</sup>                       Parsec#Megaparsecs and gigaparsecs
Mpc3               Mpc<sup>3</sup>                       Parsec#Megaparsecs and gigaparsecs
Mpc                Mpc                                   Parsec#Megaparsecs and gigaparsecs
Gpc2               Gpc<sup>2</sup>                       Parsec#Megaparsecs and gigaparsecs
Gpc3               Gpc<sup>3</sup>                       Parsec#Megaparsecs and gigaparsecs
Gpc                Gpc                                   Parsec#Megaparsecs and gigaparsecs

== Nuclear Physics and Chemistry ==
cm-1               cm<sup>−1</sup>                       Wavenumber
u                  u                                     Atomic mass unit
osmol              osmol                                 Osmole (unit)
Osm                Osm                                   Osmole (unit)
kg/mol             kg/mol                                Molar mass
kg.mol-1           kg&sdot;mol<sup>−1</sup>              Molar mass
g/mol              g/mol                                 Molar mass
g.mol-1            g&sdot;mol<sup>−1</sup>               Molar mass
eV/c2              eV/''c''<sup>2</sup>                  Electronvolt#Mass
keV/c2             keV/''c''<sup>2</sup>                 Electronvolt#Mass
MeV/c2             MeV/''c''<sup>2</sup>                 Electronvolt#Mass
GeV/c2             GeV/''c''<sup>2</sup>                 Electronvolt#Mass
TeV/c2             TeV/''c''<sup>2</sup>                 Electronvolt#Mass
µN                 µ<span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:85%;text-align:left"><br />N</span>     Nuclear magneton
µB                 µ<span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:85%;text-align:left"><br />B</span>     Bohr magneton
eV                 eV                                    Electronvolt
mev                meV                                   Electronvolt
keV                keV                                   Electronvolt
MeV                MeV                                   Electronvolt
GeV                GeV                                   Electronvolt
TeV                TeV                                   Electronvolt
J/mol              J/mol                                 Joule per mole
J.mol-1            J&sdot;mol<sup>−1</sup>               Joule per mole
kJ.mol-1           kJ&sdot;mol<sup>−1</sup>              Joule per mole
kJ/mol             kJ/mol                                Joule per mole
MJ.mol-1           MJ&sdot;mol<sup>−1</sup>              Joule per mole
MJ/mol             MJ/mol                                Joule per mole
GJ/mol             GJ/mol                                Joule per mole
GJ.mol-1           GJ&sdot;mol<sup>−1</sup>              Joule per mole
TJ.mol-1           TJ&sdot;mol<sup>−1</sup>              Joule per mole
TJ/mol             TJ/mol                                Joule per mole

== Numbers and phrases ==
pp                 pp                                    Page (paper)
ppb                ppb                                   Parts per billion
ppm                ppm                                   Parts per million
billiard           billiard                              Orders of magnitude (numbers)#1015
billion            billion                               1,000,000,000
billionth          billionth                             1,000,000,000
billionths         billionths                            1,000,000,000
decilliard         decilliard                            Orders of magnitude (numbers)#1063
decillion          decillion                             Orders of magnitude (numbers)#1033
decillionth        decillionth                           Orders of magnitude (numbers)#1033
decillionths       decillionths                          Orders of magnitude (numbers)#1033
milliard           milliard                              1,000,000,000
nonilliard         nonilliard                            Orders of magnitude (numbers)#1057
nonillion          nonillion                             Orders of magnitude (numbers)#1030
nonillionth        nonillionth                           Orders of magnitude (numbers)#1030
nonillionths       nonillionths                          Orders of magnitude (numbers)#1030
octilliard         octilliard                            Orders of magnitude (numbers)#1051
octillion          octillion                             Orders of magnitude (numbers)#1027
octillionth        octillionth                           Orders of magnitude (numbers)#1027
octillionths       octillionths                          Orders of magnitude (numbers)#1027
quadrilliard       quadrilliard                          Orders of magnitude (numbers)#1027
quadrillion        quadrillion                           Orders of magnitude (numbers)#1015
quadrillionth      quadrillionth                         Orders of magnitude (numbers)#1015
quadrillionths     quadrillionths                        Orders of magnitude (numbers)#1015
quintilliard       quintilliard                          Orders of magnitude (numbers)#1033
quintillion        quintillion                           Orders of magnitude (numbers)#1018
quintillionth      quintillionth                         Orders of magnitude (numbers)#1018
quintillionths     quintillionths                        Orders of magnitude (numbers)#1018
septilliard        septilliard                           Orders of magnitude (numbers)#1045
septillion         septillion                            Orders of magnitude (numbers)#1024
septillionth       septillionth                          Orders of magnitude (numbers)#1024
septillionths      septillionths                         Orders of magnitude (numbers)#1024
sextilliard        sextilliard                           Orders of magnitude (numbers)#1039
sextillion         sextillion                            Orders of magnitude (numbers)#1021
sextillionth       sextillionth                          Orders of magnitude (numbers)#1021
sextillionths      sextillionths                         Orders of magnitude (numbers)#1021
trilliard          trilliard                             Orders of magnitude (numbers)#1021
trillion           trillion                              Orders of magnitude (numbers)#1012
trillionth         trillionth                            Orders of magnitude (numbers)#1012
trillionths        trillionths                           Orders of magnitude (numbers)#1012

== Extra items from Module:Val/units. TODO: Check if these are wanted ==
m2                 m<sup>2</sup>                         Square metre
m3                 m<sup>3</sup>                         Cubic metre
m*s-1              m&sdot;s<sup>−1</sup>                 Metre per second
m*s-2              m&sdot;s<sup>−2</sup>                 Metre per second squared
N*m-1              N&sdot;m<sup>−1</sup>                 Joule (unit)
GJ*mol-1           GJ&sdot;mol<sup>−1</sup>              Joule per mole
J*mol-1            J&sdot;mol<sup>−1</sup>               Joule per mole
kJ*mol-1           kJ&sdot;mol<sup>−1</sup>              Joule per mole
MJ*mol-1           MJ&sdot;mol<sup>−1</sup>              Joule per mole
TJ*mol-1           TJ&sdot;mol<sup>−1</sup>              Joule per mole
J*s                J&sdot;s                              Joule-second
Js                 J&sdot;s                              Joule-second
μN                 µ<sub>N</sub>                         Nuclear magneton
g*mol-1            g&sdot;mol<sup>−1</sup>               Molar mass
second             s                                     Second
seconds            s                                     Second
USgal              US gal                                US gallon
H*m-1              H                                     Henry (unit)
N*A-2              N&sdot;A<sup>−2</sup>                 Permeability (electromagnetism)
torr               Torr                                  Torr
V*m-1              V&sdot;m<sup>−1</sup>                 Electric field
Vm-1               V&sdot;m<sup>−1</sup>                 Electric field
W                  W                                     Watt

]=]

-- If val has "|long scale=on" the following definitions are used
-- (if not found here, the normal definitions are used).
-- Unit code       Symbol                                Link                                   Flags
local builtin_units_long_scale = [=[

billion            billion                               Orders of magnitude (numbers)#1012
billionth          billionth                             Orders of magnitude (numbers)#1012
billionths         billionths                            Orders of magnitude (numbers)#1012
decillion          decillion                             Orders of magnitude (numbers)#1060
decillionth        decillionth                           Orders of magnitude (numbers)#1060
decillionths       decillionths                          Orders of magnitude (numbers)#1060
nonillion          nonillion                             Orders of magnitude (numbers)#1054
nonillionth        nonillionth                           Orders of magnitude (numbers)#1054
nonillionths       nonillionths                          Orders of magnitude (numbers)#1054
octillion          octillion                             Orders of magnitude (numbers)#1048
octillionth        octillionth                           Orders of magnitude (numbers)#1048
octillionths       octillionths                          Orders of magnitude (numbers)#1048
quadrillion        quadrillion                           Orders of magnitude (numbers)#1024
quadrillionth      quadrillionth                         Orders of magnitude (numbers)#1024
quadrillionths     quadrillionths                        Orders of magnitude (numbers)#1024
quintillion        quintillion                           Orders of magnitude (numbers)#1030
quintillionth      quintillionth                         Orders of magnitude (numbers)#1030
quintillionths     quintillionths                        Orders of magnitude (numbers)#1030
septillion         septillion                            Orders of magnitude (numbers)#1042
septillionth       septillionth                          Orders of magnitude (numbers)#1042
septillionths      septillionths                         Orders of magnitude (numbers)#1042
sextillion         sextillion                            Orders of magnitude (numbers)#1036
sextillionth       sextillionth                          Orders of magnitude (numbers)#1036
sextillionths      sextillionths                         Orders of magnitude (numbers)#1036
trillion           trillion                              Orders of magnitude (numbers)#1018
trillionth         trillionth                            Orders of magnitude (numbers)#1018
trillionths        trillionths                           Orders of magnitude (numbers)#1018

]=]

-- Items from Module:Val/units which have different definitions from those above.
-- TODO: Are any of these needed? Can they be deleted?
local removed_units = [=[

µA                 µA                                    microampere
aA                 aA                                    attoampere
cA                 cA                                    centiampere
daA                daA                                   decaampere
fA                 fA                                    femtoampere
GA                 GA                                    gigaampere
hA                 hA                                    hectoampere
kA                 kA                                    kiloampere
MA                 MA                                    megaampere
mA                 mA                                    milliampere
µV                 µV                                    microvolt
fV                 fV                                    femtovolt
GV                 GV                                    gigavolt
kV                 kV                                    kilovolt
aHz                aHz                                   attohertz
cHz                cHz                                   centihertz
daHz               daHz                                  decahertz
EHz                EHz                                   exahertz
fHz                fHz                                   femtohertz
hHz                hHz                                   hectohertz
PHz                PHz                                   petahertz
THz                THz                                   terahertz
YHz                YHz                                   yottahertz
am                 am                                    attometre
ym                 ym                                    yoctometre
zm                 zm                                    zeptometre
dag                dag                                   decagram
Tg                 Tg                                    teragram
Gyr                Ga                                    gigaannum
mya                mya                                   million years ago
degC               °C                                    degree Celsius
GPa                GPa                                   gigapascal
kg/cm3             kg/cm<sup>3</sup>                     density#Formula and common units
µB                 µ<sub>B</sub>                         Bohr magneton
µN                 µ<sub>N</sub>                         nuclear magneton
g/mol              g&sdot;mol<sup>−1</sup>               molar mass
kg/mol             kg&sdot;mol<sup>−1</sup>              molar mass
Gpc                Gpc                                   megaparsec#Megaparsecs and gigaparsecs
Gpc2               Gpc<sup>2</sup>                       megaparsec#Megaparsecs and gigaparsecs
Gpc3               Gpc<sup>3</sup>                       megaparsec#Megaparsecs and gigaparsecs
kpc                kpc                                   kiloparsec
kpc2               kpc<sup>2</sup>                       kiloparsec
kpc3               kpc<sup>3</sup>                       kiloparsec
Mpc                Mpc                                   parsec#Megaparsecs and gigaparsecs
Mpc2               Mpc<sup>2</sup>                       parsec#Megaparsecs and gigaparsecs
Mpc3               Mpc<sup>3</sup>                       parsec#Megaparsecs and gigaparsecs

]=]

local function get_builtin_unit(unitcode, definitions)
	-- Return table of information for the specified built-in unit, or nil if not known.
	-- Each defined unit code must be followed by two spaces (not tab characters).
	local _, pos = definitions:find('\n' .. unitcode .. '  ', 1, true)
	if pos then
		local endline = definitions:find('\n', pos, true)
		if endline then
			local result = {}
			local n = 0
			local text = definitions:sub(pos, endline - 1)
			for item in (text .. '  '):gmatch('(%S[^\n]-)%s%s') do
				if item == 'NOSPACE' then
					result.nospace = true
				else
					n = n + 1
					if n == 1 then
						result.symbol = item
					elseif n == 2 then
						result.link = item
					else
						break
					end
				end
			end
			if n == 2 then
				return result
			end
			-- Ignore invalid definition.
		end
	end
end

local function get_unit(ucode, value, want_link, want_longscale)
	local result = want_longscale and
		get_builtin_unit(ucode, builtin_units_long_scale) or
		get_builtin_unit(ucode, builtin_units)
	local lookup = require('Module:Convert/sandbox')._unit
	local convert_unit = lookup(ucode, { value = value, link = want_link })
	if result then
		-- Have: result.symbol + result.link + result.nospace
		if want_link then
			result.text = '[[' .. result.link .. '|' .. result.symbol .. ']]'
		else
			result.text = result.symbol
		end
		result.sortkey = convert_unit.sortkey
	else
		result = {
			text = convert_unit.text,
			sortkey = convert_unit.sortkey,
		}
	end
	return result
end

local function bracketed(ucode, text)
	if ucode:find('[*./]') then
		return '(' .. text .. ')'
	end
	return text
end

local function makeunit(ucode, options)
	-- Return wikitext, sortkey for the requested unit and options.
	-- LATER The sortkey does not account for any per unit.
	options = options or {}
	local unit = get_unit(ucode, options.value, options.link, options.longscale)
	local text = unit.text
	local percode = options.per
	if percode then
		local perunit = get_unit(percode, 0, options.per_link, options.longscale)
		text = bracketed(ucode, text) .. '/' .. bracketed(percode, perunit.text)
	end
	if not unit.nospace then
		text = '&nbsp;' .. text
	end
	return text, unit.sortkey
end

return makeunit