Template:Val/units/doc

From Simple English Wikipedia, the free encyclopedia

Introduction[change source]

Val/units specializes in providing easy unit-code system management. Here you can add or alter unit markup and unit wikilink. You can see that the unit "code" is basically the abbreviated unit(s) name, and a dot . to multiply or a slash / to divide dimensions.

If the unit code is not found here, we call {{convert}} with that unit code. {{Convert}} manages thousands of units and recognizes most unit codes you could try. Convert's unit codes are published as a courtesy in a simple list at {{Val/unitsfromconvert}}. For example, {{convert}} has the unit nmi (nautical mile), so we don't list it because its markup and link are incontestable.

But a unit that differs in markup or linking between Val and Convert is not rare. {{Convert}} specializes in units that are converted, so {{Convert}} prefers that C and F are for Celsius and Fahrenheit. Val specializes in all units, but prefers physics, where C and F are for coulomb and farad. Both templates recognize degC and degF.

(See how to add units to {{convert}}.)

Purpose[change source]

This Val sub-template translates a unit code to a link and to markup. This happens whenever Val gets a "u" parameter: |u=, |up=, |ul= or |upl=.

The contents of this page show that the purpose of the "unit code" is to translate to a normal wikilink, with the unit's article to left of the pipe, and the unit's markup (possibly using markup templates or HTML) to the right. It's organized by subject.

For each unit this template will:

  • display its easily type-able unit code
  • show to which article the unit is linked
  • configure new or existing units

Here you can even invent your own "unit code". If a unit code you need is not already available, or is not correctly managed, add it here and create its markup and link, as the other entries do. See below for details.

Before removing any Val unit codes, you can check to see how unit codes may or may not be in use on the wiki by employing {{Template usage}}. For example, to see about changing or removing unit code J.s, do a {{tlusage|val|J\.s|0}}hastemplate:"val" insource:/\{\{ *[Vv]al *\|[^}]*J\.s/ prefix::.

This page is a configuration file, or "config file" made with a switch statement embedded with partial transclusion tags that enables an editor unfamiliar with any template coding to view and edit a configurable template element safely and intuitively. The partial transclusion tags also enable the rendered commentary, all within the switch statement.

Arguments[change source]

1 The easily type-able name of the unit. See also {{Val/unitsfromconvert}}
lk Lowercase letters "L" and "K". Internal parameter. Lk=1 or lk=on, lk=anything, set to any value it always generates lk=off. If not explicitly set it generates lk=on. These are what is required, at times, to call {{Convert}} with its linking turned on or off.

Examples[change source]

{{val/units|m/s}}  → 

-- Definitions for units known to val -- File format is two strings and a return statement with them in it: -- string in quotes [=[ ... builtin_units ... ]=]. -- string in quotes [=[ ... builtin_units_long_scale ... ]=]. -- First string, builtin_units, is short-scale, second string is long scale.

-- Entry format: -- One record per line, starting in first column, having 2-4 fields. -- Field separator: two or more spaces -- Between first and second fields: two or more spaces -- Between all other fields: two or more spaces, or one or more tabs -- Entries without two spaces in them are ignored.

-- There must be a blank line before the first entry and after the last. -- I.e. the first two and last two characters of the string must be newlines.

-- Format of entry. Two record types: -- -- One record type is a wikilink: -- Unit-code Symbol-accepts-HTML-only -- Text-field separator is still two spaces. Two spaces not allowed in wikilink. -- -- The other record type is all fields: -- Unit-code symbol-accepts-HTML-only pagename#section-OK -- -- Plus there is an optional field that goes at the end after two or more spaces. -- Whether it is a number or an equation or the letters SI, -- any of these three has the same function: a wikitable sorting "scale". -- It is for sorting, and it works for either record type. -- Difference is SI can't accept HTML. But SI correctly scales any SI prefix. -- (Optional fields ALIAS and NOSPACE and ANGLE are for advanced users.)

-- "Invalid unit" error: -- Using SI requires that the symbol equal unit-code, so never allows HTML. -- Any difference between SI or symbol must be an SI prefix, such as k, M, or G. -- A space at the end of an entry is an error. No space at each EOL.

local builtin_units = [=[

Test[change source]

Foo Foo Baz baz0 Baz baz0 Bar bar0 quux bar0

Unsorted units[change source]

c0 c0 lbf lbF N.s N⋅s J.K-1 J⋅K−1 C.mol-1 C⋅mol−1 C/mol C/mol C.kg-1 C⋅kg−1 C/kg C/kg F.m-1 F⋅m−1 F/m F/m e e kB kB 8e3 KB KB 8e3 MB MB 8e6 GB GB 8e9 TB TB 8e12 lx lx nat nat

Time and frequency[change source]

byte/s byte/s 8 kB/s kB/s 8e3 MB/s MB/s 8e6 GB/s GB/s 8e9 TB/s TB/s 8e12 bit/s bit/s 1 bps bit/s 1 kbit/s kbit/s 1e3 Mbit/s Mbit/s 1e6 Gbit/s Gbit/s 1e9 Tbit/s Tbit/s 1e12 kT/s kT/s 1e3 MT/s MT/s 1e6 GT/s GT/s 1e9 year year 31557600 years years 31557600 yr yr 31557600 y y 31557600 a a 31557600 Ga Ga 31557600000000000 Ma Ma 31557600000000 ka ka 31557600000 kyr kyr 31557600000 kya kya 31557600000 myr myr 31557600000000 mya mya 31557600000000 byr byr 31557600000000000 bya bya 31557600000000000 Gyr Gyr 31557600000000000 BP BP uBP 14C yr BP BC BC -1 AD AD 1 BCE BCE -1 CE CE 1 JD JD 1 MJD MJD 1

s-1 s−1 s-2 s−2 s2 s2

s s SI as s SI cs s SI das s SI ds s SI Es s SI fs s SI Gs s SI hs s SI ks s SI ms s SI µs s SI us s SI Ms s SI ns s SI ps s SI Ps s SI Ts s SI Ys s SI ys s SI Zs s SI zs s SI

Hz Hz SI aHz Hz SI cHz Hz SI daHz Hz SI dHz Hz SI EHz Hz SI fHz Hz SI hHz Hz SI GHz Hz SI kHz Hz SI MHz Hz SI mHz Hz SI uHz Hz SI µHz Hz SI nHz Hz SI pHz Hz SI PHz Hz SI THz Hz SI yHz Hz SI YHz Hz SI zHz Hz SI ZHz Hz SI

ips ips

Length, area, volume[change source]

Å3 Å3 fb-1 fb−1 m-1 m−1 m-2 m−2 m-3 m−3 km2 km2 km3 km3 µm2 µm2 um2 µm2 am2 am2 cm2 cm2 dam2 dam2 dm2 dm2 Em2 Em2 fm2 fm2 Gm2 Gm2 hm2 hm2 mm2 mm2 Mm2 Mm2 nm2 nm2 pm2 pm2 Pm2 Pm2 Tm2 Tm2 ym2 ym2 Ym2 Ym2 zm2 zm2 Zm2 Zm2 gal gal Gal Gal uGal µGal µGal µGal mGal mGal

b b SI ab b SI cb b SI dab b SI db b SI Eb b SI fb b SI Gb b SI hb b SI kb b SI mb b SI µb b SI ub b SI Mb b SI nb b SI pb b SI Pb b SI Tb b SI Yb b SI yb b SI Zb b SI zb b SI

Velocity and acceleration[change source]

m.s-2 m⋅s−2 m/s2 m/s2 m.s-1 m⋅s−1 m/s m/s km.s-1 km⋅s−1 km/s km/s

Mass and energy[change source]

lbm lbm uJ µJ J.s J⋅s kWh kWh kW.h kW⋅h J/C J/C J/kg J/kg

Da Da SI EDa Da SI PDa Da SI TDa Da SI GDa Da SI MDa Da SI kDa Da SI mDa Da SI uDa Da SI μDa Da SI nDa Da SI pDa Da SI fDa Da SI aDa Da SI

g g SI ag g SI cg g SI dag g SI dg g SI Eg g SI fg g SI Gg g SI hg g SI kg g SI mcg g SI Mg g SI mg g SI ug g SI µg g SI ng g SI Pg g SI pg g SI Tg g SI yg g SI Yg g SI zg g SI Zg g SI

Pressure and density[change source]

psi psi g.cm-3 g⋅cm−3 g/cm3 g/cm3 kg.m-3 kg⋅m−3 kg/m3 kg/m3 kg/cm3 kg/cm3 g/L g/L g/l g/l mcg/dL µg/dL mcg/dl µg/dl mg/mL mg/mL mg/ml mg/ml ug/dL µg/dL ug/dl µg/dl μg/dL μg/dL μg/dl μg/dl mg.L-1 mg/L mg/L mg/L mg.l-1 mg/l mg/l mg/l

Fracture toughness[change source]

MPa.m.5 MPa⋅m1/2 kPa.m.5 kPa⋅m1/2 Pa.m.5 Pa⋅m1/2

Temperature[change source]

degC °C ALIAS degF °F ALIAS degR °R ALIAS

K K SI YK K SI ZK K SI EK K SI PK K SI TK K SI GK K SI MK K SI kK K SI hK K SI daK K SI dK K SI cK K SI mK K SI µK K SI uK K SI nK K SI pK K SI fK K SI aK K SI zK K SI yK K SI

Electromagnetism[change source]

Wb Wb N.A-2 N⋅A−2 H.m-1 H⋅m−1 V.m-1 V⋅m−1 V/m V/m

C C SI YC C SI ZC C SI EC C SI PC C SI TC C SI GC C SI MC C SI kC C SI hC C SI daC C SI dC C SI cC C SI mC C SI µC C SI uC C SI nC C SI pC C SI fC C SI aC C SI zC C SI yC C SI

F F SI YF F SI ZF F SI EF F SI PF F SI TF F SI GF F SI MF F SI kF F SI hF F SI daF F SI dF F SI cF F SI mF F SI µF F SI uF F SI nF F SI pF F SI fF F SI aF F SI zF F SI yF F SI

H H SI YH H SI ZH H SI EH H SI PH H SI TH H SI GH H SI MH H SI kH H SI hH H SI daH H SI dH H SI cH H SI mH H SI µH H SI uH H SI nH H SI pH H SI fH H SI aH H SI zH H SI yH H SI

A A SI YA A SI ZA A SI EA A SI PA A SI TA A SI GA A SI MA A SI kA A SI hA A SI daA A SI dA A SI cA A SI mA A SI µA A SI uA A SI nA A SI pA A SI fA A SI aA A SI zA A SI yA A SI

V V SI YV V SI ZV V SI EV V SI PV V SI TV V SI GV V SI MV V SI kV V SI hV V SI daV V SI dV V SI cV V SI mV V SI µV V SI uV V SI nV V SI pV V SI fV V SI aV V SI zV V SI yV V SI

VA VA SI YVA VA SI ZVA VA SI EVA VA SI PVA VA SI TVA VA SI GVA VA SI MVA VA SI kVA VA SI hVA VA SI daVA VA SI dVA VA SI cVA VA SI mVA VA SI µVA VA SI uVA VA SI nVA VA SI pVA VA SI fVA VA SI aVA VA SI zVA VA SI yVA VA SI

Ω Ω SI

YΩ.m YΩ⋅m 1e24 ZΩ.m ZΩ⋅m 1e21 EΩ.m EΩ⋅m 1e18 PΩ.m PΩ⋅m 1e15 TΩ.m TΩ⋅m 1e12 GΩ.m GΩ⋅m 1e9 MΩ.m MΩ⋅m 1e6 kΩ.m kΩ⋅m 1e3 Ω.m Ω⋅m 1 mΩ.m mΩ⋅m 1e-3 µΩ.m µΩ⋅m 1e-6 uΩ.m µΩ⋅m 1e-6 nΩ.m nΩ⋅m 1e-9 pΩ.m pΩ⋅m 1e-12 fΩ.m fΩ⋅m 1e-15 aΩ.m aΩ⋅m 1e-18 zΩ.m zΩ⋅m 1e-21 yΩ.m yΩ⋅m 1e-24

R R SI

G G SI aG G SI cG G SI daG G SI dG G SI EG G SI fG G SI GG G SI hG G SI kG G SI MG G SI mG G SI uG G SI µG G SI nG G SI PG G SI pG G SI TG G SI yG G SI YG G SI zG G SI ZG G SI

T T SI aT T SI cT T SI daT T SI dT T SI ET T SI fT T SI GT T SI hT T SI kT T SI MT T SI mT T SI uT T SI µT T SI nT T SI PT T SI pT T SI TT T SI yT T SI YT T SI zT T SI ZT T SI

Astrophysics[change source]

au au c c ly ly dex dex Earth mass M🜨 Earth radius R🜨 M_Earth M🜨 R_Earth R🜨 M+ M🜨 R+ R🜨 Jupiter mass MJ Jupiter radius RJ Jy Jy M_Jupiter MJ R_Jupiter RJ Solar mass M solar mass M M_Solar M M_solar M R_Solar R R_solar R Solar radius R solar radius R Solar luminosity L solar luminosity L L_solar L L_Solar L Lo L pc2 pc2 pc3 pc3 kpc2 kpc2 kpc3 kpc3 kpc kpc Mpc2 Mpc2 Mpc3 Mpc3 Mpc Mpc Gpc2 Gpc2 Gpc3 Gpc3 Gpc Gpc

Nuclear physics and chemistry[change source]

cm-1 cm−1 u u osmol osmol Osm Osm M M TM M SI GM M SI MM M SI kM M SI hM M SI daM M SI dM M SI cM M SI mM M SI uM M 1e-6 nM M SI pM M SI kg.mol-1 kg⋅mol−1 kg/mol kg/mol g.mol-1 g⋅mol−1 g/mol g/mol eV/c2 eV/c2 keV/c2 keV/c2 MeV/c2 MeV/c2 GeV/c2 GeV/c2 TeV/c2 TeV/c2 eV eV meV meV keV keV MeV MeV GeV GeV TeV TeV mol-1 mol−1 J.mol-1 J⋅mol−1 J/mol J/mol kJ.mol-1 kJ⋅mol−1 kJ/mol kJ/mol MJ.mol-1 MJ⋅mol−1 MJ/mol MJ/mol GJ.mol-1 GJ⋅mol−1 GJ/mol GJ/mol TJ.mol-1 TJ⋅mol−1 TJ/mol TJ/mol

Numbers and phrases[change source]

pp pp ppb ppb 1e-9 ppm ppm 1e-6 billiard billiard 1e15 billion billion 1e9 billionth billionth 1e-9 billionths billionths 1e-9 decilliard decilliard 1e63 decillion decillion 1e33 decillionth decillionth 1e-33 decillionths decillionths 1e-33 milliard milliard 1e9 million million 1e6 millionth millionth 1e-6 millionths millionths 1e-6 nonilliard nonilliard 1e57 nonillion nonillion 1e30 nonillionth nonillionth 1e-30 nonillionths nonillionths 1e-30 octilliard octilliard 1e51 octillion octillion 1e27 octillionth octillionth 1e-27 octillionths octillionths 1e-27 quadrilliard quadrilliard 1e27 quadrillion quadrillion 1e15 quadrillionth quadrillionth 1e-15 quadrillionths quadrillionths 1e-15 quintilliard quintilliard 1e33 quintillion quintillion 1e18 quintillionth quintillionth 1e-18 quintillionths quintillionths 1e-18 septilliard septilliard 1e45 septillion septillion 1e24 septillionth septillionth 1e-24 septillionths septillionths 1e-24 sextilliard sextilliard 1e39 sextillion sextillion 1e21 sextillionth sextillionth 1e-21 sextillionths sextillionths 1e-21 trilliard trilliard 1e21 trillion trillion 1e12 trillionth trillionth 1e-12 trillionths trillionths 1e-12

Angles[change source]

%  % Percent ANGLE 0.01 percent  % Percent ANGLE 0.01 per cent  % Percent ANGLE 0.01 ‰ ‰ Per mil ANGLE 1e-3 per mil ‰ Per mil ANGLE 1e-3 per mill ‰ Per mil ANGLE 1e-3 per mille ‰ Per mil ANGLE 1e-3 permil ‰ Per mil ANGLE 1e-3 permill ‰ Per mil ANGLE 1e-3 permille ‰ Per mil ANGLE 1e-3 ° ° Degree (angle) ANGLE pi/180 deg ° Degree (angle) ANGLE pi/180 ' ′ Minute of arc ANGLE pi/10800 ′ ′ Minute of arc ANGLE pi/10800 arcmin ′ Minute of arc ANGLE pi/10800 arcminute ′ Minute of arc ANGLE pi/10800 " ″ Second of arc ANGLE pi/648000 ″ ″ Second of arc ANGLE pi/648000 arcsec ″ Second of arc ANGLE pi/648000 arcsecond ″ Second of arc ANGLE pi/648000 mas mas pi/648000000

]=]

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

Long scale numbers and phrases[change source]

billion billion 1e12 billionth billionth 1e-12 billionths billionths 1e-12 decillion decillion 1e60 decillionth decillionth 1e-60 decillionths decillionths 1e-60 nonillion nonillion 1e54 nonillionth nonillionth 1e-54 nonillionths nonillionths 1e-54 octillion octillion 1e48 octillionth octillionth 1e-48 octillionths octillionths 1e-48 quadrillion quadrillion 1e24 quadrillionth quadrillionth 1e-24 quadrillionths quadrillionths 1e-24 quintillion quintillion 1e30 quintillionth quintillionth 1e-30 quintillionths quintillionths 1e-30 septillion septillion 1e42 septillionth septillionth 1e-42 septillionths septillionths 1e-42 sextillion sextillion 1e36 sextillionth sextillionth 1e-36 sextillionths sextillionths 1e-36 trillion trillion 1e18 trillionth trillionth 1e-18 trillionths trillionths 1e-18

]=]

return { builtin_units = builtin_units, builtin_units_long_scale = builtin_units_long_scale }

{{val/units|m.s-1}}  → 

-- Definitions for units known to val -- File format is two strings and a return statement with them in it: -- string in quotes [=[ ... builtin_units ... ]=]. -- string in quotes [=[ ... builtin_units_long_scale ... ]=]. -- First string, builtin_units, is short-scale, second string is long scale.

-- Entry format: -- One record per line, starting in first column, having 2-4 fields. -- Field separator: two or more spaces -- Between first and second fields: two or more spaces -- Between all other fields: two or more spaces, or one or more tabs -- Entries without two spaces in them are ignored.

-- There must be a blank line before the first entry and after the last. -- I.e. the first two and last two characters of the string must be newlines.

-- Format of entry. Two record types: -- -- One record type is a wikilink: -- Unit-code Symbol-accepts-HTML-only -- Text-field separator is still two spaces. Two spaces not allowed in wikilink. -- -- The other record type is all fields: -- Unit-code symbol-accepts-HTML-only pagename#section-OK -- -- Plus there is an optional field that goes at the end after two or more spaces. -- Whether it is a number or an equation or the letters SI, -- any of these three has the same function: a wikitable sorting "scale". -- It is for sorting, and it works for either record type. -- Difference is SI can't accept HTML. But SI correctly scales any SI prefix. -- (Optional fields ALIAS and NOSPACE and ANGLE are for advanced users.)

-- "Invalid unit" error: -- Using SI requires that the symbol equal unit-code, so never allows HTML. -- Any difference between SI or symbol must be an SI prefix, such as k, M, or G. -- A space at the end of an entry is an error. No space at each EOL.

local builtin_units = [=[

Test[change source]

Foo Foo Baz baz0 Baz baz0 Bar bar0 quux bar0

Unsorted units[change source]

c0 c0 lbf lbF N.s N⋅s J.K-1 J⋅K−1 C.mol-1 C⋅mol−1 C/mol C/mol C.kg-1 C⋅kg−1 C/kg C/kg F.m-1 F⋅m−1 F/m F/m e e kB kB 8e3 KB KB 8e3 MB MB 8e6 GB GB 8e9 TB TB 8e12 lx lx nat nat

Time and frequency[change source]

byte/s byte/s 8 kB/s kB/s 8e3 MB/s MB/s 8e6 GB/s GB/s 8e9 TB/s TB/s 8e12 bit/s bit/s 1 bps bit/s 1 kbit/s kbit/s 1e3 Mbit/s Mbit/s 1e6 Gbit/s Gbit/s 1e9 Tbit/s Tbit/s 1e12 kT/s kT/s 1e3 MT/s MT/s 1e6 GT/s GT/s 1e9 year year 31557600 years years 31557600 yr yr 31557600 y y 31557600 a a 31557600 Ga Ga 31557600000000000 Ma Ma 31557600000000 ka ka 31557600000 kyr kyr 31557600000 kya kya 31557600000 myr myr 31557600000000 mya mya 31557600000000 byr byr 31557600000000000 bya bya 31557600000000000 Gyr Gyr 31557600000000000 BP BP uBP 14C yr BP BC BC -1 AD AD 1 BCE BCE -1 CE CE 1 JD JD 1 MJD MJD 1

s-1 s−1 s-2 s−2 s2 s2

s s SI as s SI cs s SI das s SI ds s SI Es s SI fs s SI Gs s SI hs s SI ks s SI ms s SI µs s SI us s SI Ms s SI ns s SI ps s SI Ps s SI Ts s SI Ys s SI ys s SI Zs s SI zs s SI

Hz Hz SI aHz Hz SI cHz Hz SI daHz Hz SI dHz Hz SI EHz Hz SI fHz Hz SI hHz Hz SI GHz Hz SI kHz Hz SI MHz Hz SI mHz Hz SI uHz Hz SI µHz Hz SI nHz Hz SI pHz Hz SI PHz Hz SI THz Hz SI yHz Hz SI YHz Hz SI zHz Hz SI ZHz Hz SI

ips ips

Length, area, volume[change source]

Å3 Å3 fb-1 fb−1 m-1 m−1 m-2 m−2 m-3 m−3 km2 km2 km3 km3 µm2 µm2 um2 µm2 am2 am2 cm2 cm2 dam2 dam2 dm2 dm2 Em2 Em2 fm2 fm2 Gm2 Gm2 hm2 hm2 mm2 mm2 Mm2 Mm2 nm2 nm2 pm2 pm2 Pm2 Pm2 Tm2 Tm2 ym2 ym2 Ym2 Ym2 zm2 zm2 Zm2 Zm2 gal gal Gal Gal uGal µGal µGal µGal mGal mGal

b b SI ab b SI cb b SI dab b SI db b SI Eb b SI fb b SI Gb b SI hb b SI kb b SI mb b SI µb b SI ub b SI Mb b SI nb b SI pb b SI Pb b SI Tb b SI Yb b SI yb b SI Zb b SI zb b SI

Velocity and acceleration[change source]

m.s-2 m⋅s−2 m/s2 m/s2 m.s-1 m⋅s−1 m/s m/s km.s-1 km⋅s−1 km/s km/s

Mass and energy[change source]

lbm lbm uJ µJ J.s J⋅s kWh kWh kW.h kW⋅h J/C J/C J/kg J/kg

Da Da SI EDa Da SI PDa Da SI TDa Da SI GDa Da SI MDa Da SI kDa Da SI mDa Da SI uDa Da SI μDa Da SI nDa Da SI pDa Da SI fDa Da SI aDa Da SI

g g SI ag g SI cg g SI dag g SI dg g SI Eg g SI fg g SI Gg g SI hg g SI kg g SI mcg g SI Mg g SI mg g SI ug g SI µg g SI ng g SI Pg g SI pg g SI Tg g SI yg g SI Yg g SI zg g SI Zg g SI

Pressure and density[change source]

psi psi g.cm-3 g⋅cm−3 g/cm3 g/cm3 kg.m-3 kg⋅m−3 kg/m3 kg/m3 kg/cm3 kg/cm3 g/L g/L g/l g/l mcg/dL µg/dL mcg/dl µg/dl mg/mL mg/mL mg/ml mg/ml ug/dL µg/dL ug/dl µg/dl μg/dL μg/dL μg/dl μg/dl mg.L-1 mg/L mg/L mg/L mg.l-1 mg/l mg/l mg/l

Fracture toughness[change source]

MPa.m.5 MPa⋅m1/2 kPa.m.5 kPa⋅m1/2 Pa.m.5 Pa⋅m1/2

Temperature[change source]

degC °C ALIAS degF °F ALIAS degR °R ALIAS

K K SI YK K SI ZK K SI EK K SI PK K SI TK K SI GK K SI MK K SI kK K SI hK K SI daK K SI dK K SI cK K SI mK K SI µK K SI uK K SI nK K SI pK K SI fK K SI aK K SI zK K SI yK K SI

Electromagnetism[change source]

Wb Wb N.A-2 N⋅A−2 H.m-1 H⋅m−1 V.m-1 V⋅m−1 V/m V/m

C C SI YC C SI ZC C SI EC C SI PC C SI TC C SI GC C SI MC C SI kC C SI hC C SI daC C SI dC C SI cC C SI mC C SI µC C SI uC C SI nC C SI pC C SI fC C SI aC C SI zC C SI yC C SI

F F SI YF F SI ZF F SI EF F SI PF F SI TF F SI GF F SI MF F SI kF F SI hF F SI daF F SI dF F SI cF F SI mF F SI µF F SI uF F SI nF F SI pF F SI fF F SI aF F SI zF F SI yF F SI

H H SI YH H SI ZH H SI EH H SI PH H SI TH H SI GH H SI MH H SI kH H SI hH H SI daH H SI dH H SI cH H SI mH H SI µH H SI uH H SI nH H SI pH H SI fH H SI aH H SI zH H SI yH H SI

A A SI YA A SI ZA A SI EA A SI PA A SI TA A SI GA A SI MA A SI kA A SI hA A SI daA A SI dA A SI cA A SI mA A SI µA A SI uA A SI nA A SI pA A SI fA A SI aA A SI zA A SI yA A SI

V V SI YV V SI ZV V SI EV V SI PV V SI TV V SI GV V SI MV V SI kV V SI hV V SI daV V SI dV V SI cV V SI mV V SI µV V SI uV V SI nV V SI pV V SI fV V SI aV V SI zV V SI yV V SI

VA VA SI YVA VA SI ZVA VA SI EVA VA SI PVA VA SI TVA VA SI GVA VA SI MVA VA SI kVA VA SI hVA VA SI daVA VA SI dVA VA SI cVA VA SI mVA VA SI µVA VA SI uVA VA SI nVA VA SI pVA VA SI fVA VA SI aVA VA SI zVA VA SI yVA VA SI

Ω Ω SI

YΩ.m YΩ⋅m 1e24 ZΩ.m ZΩ⋅m 1e21 EΩ.m EΩ⋅m 1e18 PΩ.m PΩ⋅m 1e15 TΩ.m TΩ⋅m 1e12 GΩ.m GΩ⋅m 1e9 MΩ.m MΩ⋅m 1e6 kΩ.m kΩ⋅m 1e3 Ω.m Ω⋅m 1 mΩ.m mΩ⋅m 1e-3 µΩ.m µΩ⋅m 1e-6 uΩ.m µΩ⋅m 1e-6 nΩ.m nΩ⋅m 1e-9 pΩ.m pΩ⋅m 1e-12 fΩ.m fΩ⋅m 1e-15 aΩ.m aΩ⋅m 1e-18 zΩ.m zΩ⋅m 1e-21 yΩ.m yΩ⋅m 1e-24

R R SI

G G SI aG G SI cG G SI daG G SI dG G SI EG G SI fG G SI GG G SI hG G SI kG G SI MG G SI mG G SI uG G SI µG G SI nG G SI PG G SI pG G SI TG G SI yG G SI YG G SI zG G SI ZG G SI

T T SI aT T SI cT T SI daT T SI dT T SI ET T SI fT T SI GT T SI hT T SI kT T SI MT T SI mT T SI uT T SI µT T SI nT T SI PT T SI pT T SI TT T SI yT T SI YT T SI zT T SI ZT T SI

Astrophysics[change source]

au au c c ly ly dex dex Earth mass M🜨 Earth radius R🜨 M_Earth M🜨 R_Earth R🜨 M+ M🜨 R+ R🜨 Jupiter mass MJ Jupiter radius RJ Jy Jy M_Jupiter MJ R_Jupiter RJ Solar mass M solar mass M M_Solar M M_solar M R_Solar R R_solar R Solar radius R solar radius R Solar luminosity L solar luminosity L L_solar L L_Solar L Lo L pc2 pc2 pc3 pc3 kpc2 kpc2 kpc3 kpc3 kpc kpc Mpc2 Mpc2 Mpc3 Mpc3 Mpc Mpc Gpc2 Gpc2 Gpc3 Gpc3 Gpc Gpc

Nuclear physics and chemistry[change source]

cm-1 cm−1 u u osmol osmol Osm Osm M M TM M SI GM M SI MM M SI kM M SI hM M SI daM M SI dM M SI cM M SI mM M SI uM M 1e-6 nM M SI pM M SI kg.mol-1 kg⋅mol−1 kg/mol kg/mol g.mol-1 g⋅mol−1 g/mol g/mol eV/c2 eV/c2 keV/c2 keV/c2 MeV/c2 MeV/c2 GeV/c2 GeV/c2 TeV/c2 TeV/c2 eV eV meV meV keV keV MeV MeV GeV GeV TeV TeV mol-1 mol−1 J.mol-1 J⋅mol−1 J/mol J/mol kJ.mol-1 kJ⋅mol−1 kJ/mol kJ/mol MJ.mol-1 MJ⋅mol−1 MJ/mol MJ/mol GJ.mol-1 GJ⋅mol−1 GJ/mol GJ/mol TJ.mol-1 TJ⋅mol−1 TJ/mol TJ/mol

Numbers and phrases[change source]

pp pp ppb ppb 1e-9 ppm ppm 1e-6 billiard billiard 1e15 billion billion 1e9 billionth billionth 1e-9 billionths billionths 1e-9 decilliard decilliard 1e63 decillion decillion 1e33 decillionth decillionth 1e-33 decillionths decillionths 1e-33 milliard milliard 1e9 million million 1e6 millionth millionth 1e-6 millionths millionths 1e-6 nonilliard nonilliard 1e57 nonillion nonillion 1e30 nonillionth nonillionth 1e-30 nonillionths nonillionths 1e-30 octilliard octilliard 1e51 octillion octillion 1e27 octillionth octillionth 1e-27 octillionths octillionths 1e-27 quadrilliard quadrilliard 1e27 quadrillion quadrillion 1e15 quadrillionth quadrillionth 1e-15 quadrillionths quadrillionths 1e-15 quintilliard quintilliard 1e33 quintillion quintillion 1e18 quintillionth quintillionth 1e-18 quintillionths quintillionths 1e-18 septilliard septilliard 1e45 septillion septillion 1e24 septillionth septillionth 1e-24 septillionths septillionths 1e-24 sextilliard sextilliard 1e39 sextillion sextillion 1e21 sextillionth sextillionth 1e-21 sextillionths sextillionths 1e-21 trilliard trilliard 1e21 trillion trillion 1e12 trillionth trillionth 1e-12 trillionths trillionths 1e-12

Angles[change source]

%  % Percent ANGLE 0.01 percent  % Percent ANGLE 0.01 per cent  % Percent ANGLE 0.01 ‰ ‰ Per mil ANGLE 1e-3 per mil ‰ Per mil ANGLE 1e-3 per mill ‰ Per mil ANGLE 1e-3 per mille ‰ Per mil ANGLE 1e-3 permil ‰ Per mil ANGLE 1e-3 permill ‰ Per mil ANGLE 1e-3 permille ‰ Per mil ANGLE 1e-3 ° ° Degree (angle) ANGLE pi/180 deg ° Degree (angle) ANGLE pi/180 ' ′ Minute of arc ANGLE pi/10800 ′ ′ Minute of arc ANGLE pi/10800 arcmin ′ Minute of arc ANGLE pi/10800 arcminute ′ Minute of arc ANGLE pi/10800 " ″ Second of arc ANGLE pi/648000 ″ ″ Second of arc ANGLE pi/648000 arcsec ″ Second of arc ANGLE pi/648000 arcsecond ″ Second of arc ANGLE pi/648000 mas mas pi/648000000

]=]

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

Long scale numbers and phrases[change source]

billion billion 1e12 billionth billionth 1e-12 billionths billionths 1e-12 decillion decillion 1e60 decillionth decillionth 1e-60 decillionths decillionths 1e-60 nonillion nonillion 1e54 nonillionth nonillionth 1e-54 nonillionths nonillionths 1e-54 octillion octillion 1e48 octillionth octillionth 1e-48 octillionths octillionths 1e-48 quadrillion quadrillion 1e24 quadrillionth quadrillionth 1e-24 quadrillionths quadrillionths 1e-24 quintillion quintillion 1e30 quintillionth quintillionth 1e-30 quintillionths quintillionths 1e-30 septillion septillion 1e42 septillionth septillionth 1e-42 septillionths septillionths 1e-42 sextillion sextillion 1e36 sextillionth sextillionth 1e-36 sextillionths sextillionths 1e-36 trillion trillion 1e18 trillionth trillionth 1e-18 trillionths trillionths 1e-18

]=]

return { builtin_units = builtin_units, builtin_units_long_scale = builtin_units_long_scale }

{{val/units|MeV}}  → 

-- Definitions for units known to val -- File format is two strings and a return statement with them in it: -- string in quotes [=[ ... builtin_units ... ]=]. -- string in quotes [=[ ... builtin_units_long_scale ... ]=]. -- First string, builtin_units, is short-scale, second string is long scale.

-- Entry format: -- One record per line, starting in first column, having 2-4 fields. -- Field separator: two or more spaces -- Between first and second fields: two or more spaces -- Between all other fields: two or more spaces, or one or more tabs -- Entries without two spaces in them are ignored.

-- There must be a blank line before the first entry and after the last. -- I.e. the first two and last two characters of the string must be newlines.

-- Format of entry. Two record types: -- -- One record type is a wikilink: -- Unit-code Symbol-accepts-HTML-only -- Text-field separator is still two spaces. Two spaces not allowed in wikilink. -- -- The other record type is all fields: -- Unit-code symbol-accepts-HTML-only pagename#section-OK -- -- Plus there is an optional field that goes at the end after two or more spaces. -- Whether it is a number or an equation or the letters SI, -- any of these three has the same function: a wikitable sorting "scale". -- It is for sorting, and it works for either record type. -- Difference is SI can't accept HTML. But SI correctly scales any SI prefix. -- (Optional fields ALIAS and NOSPACE and ANGLE are for advanced users.)

-- "Invalid unit" error: -- Using SI requires that the symbol equal unit-code, so never allows HTML. -- Any difference between SI or symbol must be an SI prefix, such as k, M, or G. -- A space at the end of an entry is an error. No space at each EOL.

local builtin_units = [=[

Test[change source]

Foo Foo Baz baz0 Baz baz0 Bar bar0 quux bar0

Unsorted units[change source]

c0 c0 lbf lbF N.s N⋅s J.K-1 J⋅K−1 C.mol-1 C⋅mol−1 C/mol C/mol C.kg-1 C⋅kg−1 C/kg C/kg F.m-1 F⋅m−1 F/m F/m e e kB kB 8e3 KB KB 8e3 MB MB 8e6 GB GB 8e9 TB TB 8e12 lx lx nat nat

Time and frequency[change source]

byte/s byte/s 8 kB/s kB/s 8e3 MB/s MB/s 8e6 GB/s GB/s 8e9 TB/s TB/s 8e12 bit/s bit/s 1 bps bit/s 1 kbit/s kbit/s 1e3 Mbit/s Mbit/s 1e6 Gbit/s Gbit/s 1e9 Tbit/s Tbit/s 1e12 kT/s kT/s 1e3 MT/s MT/s 1e6 GT/s GT/s 1e9 year year 31557600 years years 31557600 yr yr 31557600 y y 31557600 a a 31557600 Ga Ga 31557600000000000 Ma Ma 31557600000000 ka ka 31557600000 kyr kyr 31557600000 kya kya 31557600000 myr myr 31557600000000 mya mya 31557600000000 byr byr 31557600000000000 bya bya 31557600000000000 Gyr Gyr 31557600000000000 BP BP uBP 14C yr BP BC BC -1 AD AD 1 BCE BCE -1 CE CE 1 JD JD 1 MJD MJD 1

s-1 s−1 s-2 s−2 s2 s2

s s SI as s SI cs s SI das s SI ds s SI Es s SI fs s SI Gs s SI hs s SI ks s SI ms s SI µs s SI us s SI Ms s SI ns s SI ps s SI Ps s SI Ts s SI Ys s SI ys s SI Zs s SI zs s SI

Hz Hz SI aHz Hz SI cHz Hz SI daHz Hz SI dHz Hz SI EHz Hz SI fHz Hz SI hHz Hz SI GHz Hz SI kHz Hz SI MHz Hz SI mHz Hz SI uHz Hz SI µHz Hz SI nHz Hz SI pHz Hz SI PHz Hz SI THz Hz SI yHz Hz SI YHz Hz SI zHz Hz SI ZHz Hz SI

ips ips

Length, area, volume[change source]

Å3 Å3 fb-1 fb−1 m-1 m−1 m-2 m−2 m-3 m−3 km2 km2 km3 km3 µm2 µm2 um2 µm2 am2 am2 cm2 cm2 dam2 dam2 dm2 dm2 Em2 Em2 fm2 fm2 Gm2 Gm2 hm2 hm2 mm2 mm2 Mm2 Mm2 nm2 nm2 pm2 pm2 Pm2 Pm2 Tm2 Tm2 ym2 ym2 Ym2 Ym2 zm2 zm2 Zm2 Zm2 gal gal Gal Gal uGal µGal µGal µGal mGal mGal

b b SI ab b SI cb b SI dab b SI db b SI Eb b SI fb b SI Gb b SI hb b SI kb b SI mb b SI µb b SI ub b SI Mb b SI nb b SI pb b SI Pb b SI Tb b SI Yb b SI yb b SI Zb b SI zb b SI

Velocity and acceleration[change source]

m.s-2 m⋅s−2 m/s2 m/s2 m.s-1 m⋅s−1 m/s m/s km.s-1 km⋅s−1 km/s km/s

Mass and energy[change source]

lbm lbm uJ µJ J.s J⋅s kWh kWh kW.h kW⋅h J/C J/C J/kg J/kg

Da Da SI EDa Da SI PDa Da SI TDa Da SI GDa Da SI MDa Da SI kDa Da SI mDa Da SI uDa Da SI μDa Da SI nDa Da SI pDa Da SI fDa Da SI aDa Da SI

g g SI ag g SI cg g SI dag g SI dg g SI Eg g SI fg g SI Gg g SI hg g SI kg g SI mcg g SI Mg g SI mg g SI ug g SI µg g SI ng g SI Pg g SI pg g SI Tg g SI yg g SI Yg g SI zg g SI Zg g SI

Pressure and density[change source]

psi psi g.cm-3 g⋅cm−3 g/cm3 g/cm3 kg.m-3 kg⋅m−3 kg/m3 kg/m3 kg/cm3 kg/cm3 g/L g/L g/l g/l mcg/dL µg/dL mcg/dl µg/dl mg/mL mg/mL mg/ml mg/ml ug/dL µg/dL ug/dl µg/dl μg/dL μg/dL μg/dl μg/dl mg.L-1 mg/L mg/L mg/L mg.l-1 mg/l mg/l mg/l

Fracture toughness[change source]

MPa.m.5 MPa⋅m1/2 kPa.m.5 kPa⋅m1/2 Pa.m.5 Pa⋅m1/2

Temperature[change source]

degC °C ALIAS degF °F ALIAS degR °R ALIAS

K K SI YK K SI ZK K SI EK K SI PK K SI TK K SI GK K SI MK K SI kK K SI hK K SI daK K SI dK K SI cK K SI mK K SI µK K SI uK K SI nK K SI pK K SI fK K SI aK K SI zK K SI yK K SI

Electromagnetism[change source]

Wb Wb N.A-2 N⋅A−2 H.m-1 H⋅m−1 V.m-1 V⋅m−1 V/m V/m

C C SI YC C SI ZC C SI EC C SI PC C SI TC C SI GC C SI MC C SI kC C SI hC C SI daC C SI dC C SI cC C SI mC C SI µC C SI uC C SI nC C SI pC C SI fC C SI aC C SI zC C SI yC C SI

F F SI YF F SI ZF F SI EF F SI PF F SI TF F SI GF F SI MF F SI kF F SI hF F SI daF F SI dF F SI cF F SI mF F SI µF F SI uF F SI nF F SI pF F SI fF F SI aF F SI zF F SI yF F SI

H H SI YH H SI ZH H SI EH H SI PH H SI TH H SI GH H SI MH H SI kH H SI hH H SI daH H SI dH H SI cH H SI mH H SI µH H SI uH H SI nH H SI pH H SI fH H SI aH H SI zH H SI yH H SI

A A SI YA A SI ZA A SI EA A SI PA A SI TA A SI GA A SI MA A SI kA A SI hA A SI daA A SI dA A SI cA A SI mA A SI µA A SI uA A SI nA A SI pA A SI fA A SI aA A SI zA A SI yA A SI

V V SI YV V SI ZV V SI EV V SI PV V SI TV V SI GV V SI MV V SI kV V SI hV V SI daV V SI dV V SI cV V SI mV V SI µV V SI uV V SI nV V SI pV V SI fV V SI aV V SI zV V SI yV V SI

VA VA SI YVA VA SI ZVA VA SI EVA VA SI PVA VA SI TVA VA SI GVA VA SI MVA VA SI kVA VA SI hVA VA SI daVA VA SI dVA VA SI cVA VA SI mVA VA SI µVA VA SI uVA VA SI nVA VA SI pVA VA SI fVA VA SI aVA VA SI zVA VA SI yVA VA SI

Ω Ω SI

YΩ.m YΩ⋅m 1e24 ZΩ.m ZΩ⋅m 1e21 EΩ.m EΩ⋅m 1e18 PΩ.m PΩ⋅m 1e15 TΩ.m TΩ⋅m 1e12 GΩ.m GΩ⋅m 1e9 MΩ.m MΩ⋅m 1e6 kΩ.m kΩ⋅m 1e3 Ω.m Ω⋅m 1 mΩ.m mΩ⋅m 1e-3 µΩ.m µΩ⋅m 1e-6 uΩ.m µΩ⋅m 1e-6 nΩ.m nΩ⋅m 1e-9 pΩ.m pΩ⋅m 1e-12 fΩ.m fΩ⋅m 1e-15 aΩ.m aΩ⋅m 1e-18 zΩ.m zΩ⋅m 1e-21 yΩ.m yΩ⋅m 1e-24

R R SI

G G SI aG G SI cG G SI daG G SI dG G SI EG G SI fG G SI GG G SI hG G SI kG G SI MG G SI mG G SI uG G SI µG G SI nG G SI PG G SI pG G SI TG G SI yG G SI YG G SI zG G SI ZG G SI

T T SI aT T SI cT T SI daT T SI dT T SI ET T SI fT T SI GT T SI hT T SI kT T SI MT T SI mT T SI uT T SI µT T SI nT T SI PT T SI pT T SI TT T SI yT T SI YT T SI zT T SI ZT T SI

Astrophysics[change source]

au au c c ly ly dex dex Earth mass M🜨 Earth radius R🜨 M_Earth M🜨 R_Earth R🜨 M+ M🜨 R+ R🜨 Jupiter mass MJ Jupiter radius RJ Jy Jy M_Jupiter MJ R_Jupiter RJ Solar mass M solar mass M M_Solar M M_solar M R_Solar R R_solar R Solar radius R solar radius R Solar luminosity L solar luminosity L L_solar L L_Solar L Lo L pc2 pc2 pc3 pc3 kpc2 kpc2 kpc3 kpc3 kpc kpc Mpc2 Mpc2 Mpc3 Mpc3 Mpc Mpc Gpc2 Gpc2 Gpc3 Gpc3 Gpc Gpc

Nuclear physics and chemistry[change source]

cm-1 cm−1 u u osmol osmol Osm Osm M M TM M SI GM M SI MM M SI kM M SI hM M SI daM M SI dM M SI cM M SI mM M SI uM M 1e-6 nM M SI pM M SI kg.mol-1 kg⋅mol−1 kg/mol kg/mol g.mol-1 g⋅mol−1 g/mol g/mol eV/c2 eV/c2 keV/c2 keV/c2 MeV/c2 MeV/c2 GeV/c2 GeV/c2 TeV/c2 TeV/c2 eV eV meV meV keV keV MeV MeV GeV GeV TeV TeV mol-1 mol−1 J.mol-1 J⋅mol−1 J/mol J/mol kJ.mol-1 kJ⋅mol−1 kJ/mol kJ/mol MJ.mol-1 MJ⋅mol−1 MJ/mol MJ/mol GJ.mol-1 GJ⋅mol−1 GJ/mol GJ/mol TJ.mol-1 TJ⋅mol−1 TJ/mol TJ/mol

Numbers and phrases[change source]

pp pp ppb ppb 1e-9 ppm ppm 1e-6 billiard billiard 1e15 billion billion 1e9 billionth billionth 1e-9 billionths billionths 1e-9 decilliard decilliard 1e63 decillion decillion 1e33 decillionth decillionth 1e-33 decillionths decillionths 1e-33 milliard milliard 1e9 million million 1e6 millionth millionth 1e-6 millionths millionths 1e-6 nonilliard nonilliard 1e57 nonillion nonillion 1e30 nonillionth nonillionth 1e-30 nonillionths nonillionths 1e-30 octilliard octilliard 1e51 octillion octillion 1e27 octillionth octillionth 1e-27 octillionths octillionths 1e-27 quadrilliard quadrilliard 1e27 quadrillion quadrillion 1e15 quadrillionth quadrillionth 1e-15 quadrillionths quadrillionths 1e-15 quintilliard quintilliard 1e33 quintillion quintillion 1e18 quintillionth quintillionth 1e-18 quintillionths quintillionths 1e-18 septilliard septilliard 1e45 septillion septillion 1e24 septillionth septillionth 1e-24 septillionths septillionths 1e-24 sextilliard sextilliard 1e39 sextillion sextillion 1e21 sextillionth sextillionth 1e-21 sextillionths sextillionths 1e-21 trilliard trilliard 1e21 trillion trillion 1e12 trillionth trillionth 1e-12 trillionths trillionths 1e-12

Angles[change source]

%  % Percent ANGLE 0.01 percent  % Percent ANGLE 0.01 per cent  % Percent ANGLE 0.01 ‰ ‰ Per mil ANGLE 1e-3 per mil ‰ Per mil ANGLE 1e-3 per mill ‰ Per mil ANGLE 1e-3 per mille ‰ Per mil ANGLE 1e-3 permil ‰ Per mil ANGLE 1e-3 permill ‰ Per mil ANGLE 1e-3 permille ‰ Per mil ANGLE 1e-3 ° ° Degree (angle) ANGLE pi/180 deg ° Degree (angle) ANGLE pi/180 ' ′ Minute of arc ANGLE pi/10800 ′ ′ Minute of arc ANGLE pi/10800 arcmin ′ Minute of arc ANGLE pi/10800 arcminute ′ Minute of arc ANGLE pi/10800 " ″ Second of arc ANGLE pi/648000 ″ ″ Second of arc ANGLE pi/648000 arcsec ″ Second of arc ANGLE pi/648000 arcsecond ″ Second of arc ANGLE pi/648000 mas mas pi/648000000

]=]

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

Long scale numbers and phrases[change source]

billion billion 1e12 billionth billionth 1e-12 billionths billionths 1e-12 decillion decillion 1e60 decillionth decillionth 1e-60 decillionths decillionths 1e-60 nonillion nonillion 1e54 nonillionth nonillionth 1e-54 nonillionths nonillionths 1e-54 octillion octillion 1e48 octillionth octillionth 1e-48 octillionths octillionths 1e-48 quadrillion quadrillion 1e24 quadrillionth quadrillionth 1e-24 quadrillionths quadrillionths 1e-24 quintillion quintillion 1e30 quintillionth quintillionth 1e-30 quintillionths quintillionths 1e-30 septillion septillion 1e42 septillionth septillionth 1e-42 septillionths septillionths 1e-42 sextillion sextillion 1e36 sextillionth sextillionth 1e-36 sextillionths sextillionths 1e-36 trillion trillion 1e18 trillionth trillionth 1e-18 trillionths trillionths 1e-18

]=]

return { builtin_units = builtin_units, builtin_units_long_scale = builtin_units_long_scale }

{{val/units|kg}}  → 

-- Definitions for units known to val -- File format is two strings and a return statement with them in it: -- string in quotes [=[ ... builtin_units ... ]=]. -- string in quotes [=[ ... builtin_units_long_scale ... ]=]. -- First string, builtin_units, is short-scale, second string is long scale.

-- Entry format: -- One record per line, starting in first column, having 2-4 fields. -- Field separator: two or more spaces -- Between first and second fields: two or more spaces -- Between all other fields: two or more spaces, or one or more tabs -- Entries without two spaces in them are ignored.

-- There must be a blank line before the first entry and after the last. -- I.e. the first two and last two characters of the string must be newlines.

-- Format of entry. Two record types: -- -- One record type is a wikilink: -- Unit-code Symbol-accepts-HTML-only -- Text-field separator is still two spaces. Two spaces not allowed in wikilink. -- -- The other record type is all fields: -- Unit-code symbol-accepts-HTML-only pagename#section-OK -- -- Plus there is an optional field that goes at the end after two or more spaces. -- Whether it is a number or an equation or the letters SI, -- any of these three has the same function: a wikitable sorting "scale". -- It is for sorting, and it works for either record type. -- Difference is SI can't accept HTML. But SI correctly scales any SI prefix. -- (Optional fields ALIAS and NOSPACE and ANGLE are for advanced users.)

-- "Invalid unit" error: -- Using SI requires that the symbol equal unit-code, so never allows HTML. -- Any difference between SI or symbol must be an SI prefix, such as k, M, or G. -- A space at the end of an entry is an error. No space at each EOL.

local builtin_units = [=[

Test[change source]

Foo Foo Baz baz0 Baz baz0 Bar bar0 quux bar0

Unsorted units[change source]

c0 c0 lbf lbF N.s N⋅s J.K-1 J⋅K−1 C.mol-1 C⋅mol−1 C/mol C/mol C.kg-1 C⋅kg−1 C/kg C/kg F.m-1 F⋅m−1 F/m F/m e e kB kB 8e3 KB KB 8e3 MB MB 8e6 GB GB 8e9 TB TB 8e12 lx lx nat nat

Time and frequency[change source]

byte/s byte/s 8 kB/s kB/s 8e3 MB/s MB/s 8e6 GB/s GB/s 8e9 TB/s TB/s 8e12 bit/s bit/s 1 bps bit/s 1 kbit/s kbit/s 1e3 Mbit/s Mbit/s 1e6 Gbit/s Gbit/s 1e9 Tbit/s Tbit/s 1e12 kT/s kT/s 1e3 MT/s MT/s 1e6 GT/s GT/s 1e9 year year 31557600 years years 31557600 yr yr 31557600 y y 31557600 a a 31557600 Ga Ga 31557600000000000 Ma Ma 31557600000000 ka ka 31557600000 kyr kyr 31557600000 kya kya 31557600000 myr myr 31557600000000 mya mya 31557600000000 byr byr 31557600000000000 bya bya 31557600000000000 Gyr Gyr 31557600000000000 BP BP uBP 14C yr BP BC BC -1 AD AD 1 BCE BCE -1 CE CE 1 JD JD 1 MJD MJD 1

s-1 s−1 s-2 s−2 s2 s2

s s SI as s SI cs s SI das s SI ds s SI Es s SI fs s SI Gs s SI hs s SI ks s SI ms s SI µs s SI us s SI Ms s SI ns s SI ps s SI Ps s SI Ts s SI Ys s SI ys s SI Zs s SI zs s SI

Hz Hz SI aHz Hz SI cHz Hz SI daHz Hz SI dHz Hz SI EHz Hz SI fHz Hz SI hHz Hz SI GHz Hz SI kHz Hz SI MHz Hz SI mHz Hz SI uHz Hz SI µHz Hz SI nHz Hz SI pHz Hz SI PHz Hz SI THz Hz SI yHz Hz SI YHz Hz SI zHz Hz SI ZHz Hz SI

ips ips

Length, area, volume[change source]

Å3 Å3 fb-1 fb−1 m-1 m−1 m-2 m−2 m-3 m−3 km2 km2 km3 km3 µm2 µm2 um2 µm2 am2 am2 cm2 cm2 dam2 dam2 dm2 dm2 Em2 Em2 fm2 fm2 Gm2 Gm2 hm2 hm2 mm2 mm2 Mm2 Mm2 nm2 nm2 pm2 pm2 Pm2 Pm2 Tm2 Tm2 ym2 ym2 Ym2 Ym2 zm2 zm2 Zm2 Zm2 gal gal Gal Gal uGal µGal µGal µGal mGal mGal

b b SI ab b SI cb b SI dab b SI db b SI Eb b SI fb b SI Gb b SI hb b SI kb b SI mb b SI µb b SI ub b SI Mb b SI nb b SI pb b SI Pb b SI Tb b SI Yb b SI yb b SI Zb b SI zb b SI

Velocity and acceleration[change source]

m.s-2 m⋅s−2 m/s2 m/s2 m.s-1 m⋅s−1 m/s m/s km.s-1 km⋅s−1 km/s km/s

Mass and energy[change source]

lbm lbm uJ µJ J.s J⋅s kWh kWh kW.h kW⋅h J/C J/C J/kg J/kg

Da Da SI EDa Da SI PDa Da SI TDa Da SI GDa Da SI MDa Da SI kDa Da SI mDa Da SI uDa Da SI μDa Da SI nDa Da SI pDa Da SI fDa Da SI aDa Da SI

g g SI ag g SI cg g SI dag g SI dg g SI Eg g SI fg g SI Gg g SI hg g SI kg g SI mcg g SI Mg g SI mg g SI ug g SI µg g SI ng g SI Pg g SI pg g SI Tg g SI yg g SI Yg g SI zg g SI Zg g SI

Pressure and density[change source]

psi psi g.cm-3 g⋅cm−3 g/cm3 g/cm3 kg.m-3 kg⋅m−3 kg/m3 kg/m3 kg/cm3 kg/cm3 g/L g/L g/l g/l mcg/dL µg/dL mcg/dl µg/dl mg/mL mg/mL mg/ml mg/ml ug/dL µg/dL ug/dl µg/dl μg/dL μg/dL μg/dl μg/dl mg.L-1 mg/L mg/L mg/L mg.l-1 mg/l mg/l mg/l

Fracture toughness[change source]

MPa.m.5 MPa⋅m1/2 kPa.m.5 kPa⋅m1/2 Pa.m.5 Pa⋅m1/2

Temperature[change source]

degC °C ALIAS degF °F ALIAS degR °R ALIAS

K K SI YK K SI ZK K SI EK K SI PK K SI TK K SI GK K SI MK K SI kK K SI hK K SI daK K SI dK K SI cK K SI mK K SI µK K SI uK K SI nK K SI pK K SI fK K SI aK K SI zK K SI yK K SI

Electromagnetism[change source]

Wb Wb N.A-2 N⋅A−2 H.m-1 H⋅m−1 V.m-1 V⋅m−1 V/m V/m

C C SI YC C SI ZC C SI EC C SI PC C SI TC C SI GC C SI MC C SI kC C SI hC C SI daC C SI dC C SI cC C SI mC C SI µC C SI uC C SI nC C SI pC C SI fC C SI aC C SI zC C SI yC C SI

F F SI YF F SI ZF F SI EF F SI PF F SI TF F SI GF F SI MF F SI kF F SI hF F SI daF F SI dF F SI cF F SI mF F SI µF F SI uF F SI nF F SI pF F SI fF F SI aF F SI zF F SI yF F SI

H H SI YH H SI ZH H SI EH H SI PH H SI TH H SI GH H SI MH H SI kH H SI hH H SI daH H SI dH H SI cH H SI mH H SI µH H SI uH H SI nH H SI pH H SI fH H SI aH H SI zH H SI yH H SI

A A SI YA A SI ZA A SI EA A SI PA A SI TA A SI GA A SI MA A SI kA A SI hA A SI daA A SI dA A SI cA A SI mA A SI µA A SI uA A SI nA A SI pA A SI fA A SI aA A SI zA A SI yA A SI

V V SI YV V SI ZV V SI EV V SI PV V SI TV V SI GV V SI MV V SI kV V SI hV V SI daV V SI dV V SI cV V SI mV V SI µV V SI uV V SI nV V SI pV V SI fV V SI aV V SI zV V SI yV V SI

VA VA SI YVA VA SI ZVA VA SI EVA VA SI PVA VA SI TVA VA SI GVA VA SI MVA VA SI kVA VA SI hVA VA SI daVA VA SI dVA VA SI cVA VA SI mVA VA SI µVA VA SI uVA VA SI nVA VA SI pVA VA SI fVA VA SI aVA VA SI zVA VA SI yVA VA SI

Ω Ω SI

YΩ.m YΩ⋅m 1e24 ZΩ.m ZΩ⋅m 1e21 EΩ.m EΩ⋅m 1e18 PΩ.m PΩ⋅m 1e15 TΩ.m TΩ⋅m 1e12 GΩ.m GΩ⋅m 1e9 MΩ.m MΩ⋅m 1e6 kΩ.m kΩ⋅m 1e3 Ω.m Ω⋅m 1 mΩ.m mΩ⋅m 1e-3 µΩ.m µΩ⋅m 1e-6 uΩ.m µΩ⋅m 1e-6 nΩ.m nΩ⋅m 1e-9 pΩ.m pΩ⋅m 1e-12 fΩ.m fΩ⋅m 1e-15 aΩ.m aΩ⋅m 1e-18 zΩ.m zΩ⋅m 1e-21 yΩ.m yΩ⋅m 1e-24

R R SI

G G SI aG G SI cG G SI daG G SI dG G SI EG G SI fG G SI GG G SI hG G SI kG G SI MG G SI mG G SI uG G SI µG G SI nG G SI PG G SI pG G SI TG G SI yG G SI YG G SI zG G SI ZG G SI

T T SI aT T SI cT T SI daT T SI dT T SI ET T SI fT T SI GT T SI hT T SI kT T SI MT T SI mT T SI uT T SI µT T SI nT T SI PT T SI pT T SI TT T SI yT T SI YT T SI zT T SI ZT T SI

Astrophysics[change source]

au au c c ly ly dex dex Earth mass M🜨 Earth radius R🜨 M_Earth M🜨 R_Earth R🜨 M+ M🜨 R+ R🜨 Jupiter mass MJ Jupiter radius RJ Jy Jy M_Jupiter MJ R_Jupiter RJ Solar mass M solar mass M M_Solar M M_solar M R_Solar R R_solar R Solar radius R solar radius R Solar luminosity L solar luminosity L L_solar L L_Solar L Lo L pc2 pc2 pc3 pc3 kpc2 kpc2 kpc3 kpc3 kpc kpc Mpc2 Mpc2 Mpc3 Mpc3 Mpc Mpc Gpc2 Gpc2 Gpc3 Gpc3 Gpc Gpc

Nuclear physics and chemistry[change source]

cm-1 cm−1 u u osmol osmol Osm Osm M M TM M SI GM M SI MM M SI kM M SI hM M SI daM M SI dM M SI cM M SI mM M SI uM M 1e-6 nM M SI pM M SI kg.mol-1 kg⋅mol−1 kg/mol kg/mol g.mol-1 g⋅mol−1 g/mol g/mol eV/c2 eV/c2 keV/c2 keV/c2 MeV/c2 MeV/c2 GeV/c2 GeV/c2 TeV/c2 TeV/c2 eV eV meV meV keV keV MeV MeV GeV GeV TeV TeV mol-1 mol−1 J.mol-1 J⋅mol−1 J/mol J/mol kJ.mol-1 kJ⋅mol−1 kJ/mol kJ/mol MJ.mol-1 MJ⋅mol−1 MJ/mol MJ/mol GJ.mol-1 GJ⋅mol−1 GJ/mol GJ/mol TJ.mol-1 TJ⋅mol−1 TJ/mol TJ/mol

Numbers and phrases[change source]

pp pp ppb ppb 1e-9 ppm ppm 1e-6 billiard billiard 1e15 billion billion 1e9 billionth billionth 1e-9 billionths billionths 1e-9 decilliard decilliard 1e63 decillion decillion 1e33 decillionth decillionth 1e-33 decillionths decillionths 1e-33 milliard milliard 1e9 million million 1e6 millionth millionth 1e-6 millionths millionths 1e-6 nonilliard nonilliard 1e57 nonillion nonillion 1e30 nonillionth nonillionth 1e-30 nonillionths nonillionths 1e-30 octilliard octilliard 1e51 octillion octillion 1e27 octillionth octillionth 1e-27 octillionths octillionths 1e-27 quadrilliard quadrilliard 1e27 quadrillion quadrillion 1e15 quadrillionth quadrillionth 1e-15 quadrillionths quadrillionths 1e-15 quintilliard quintilliard 1e33 quintillion quintillion 1e18 quintillionth quintillionth 1e-18 quintillionths quintillionths 1e-18 septilliard septilliard 1e45 septillion septillion 1e24 septillionth septillionth 1e-24 septillionths septillionths 1e-24 sextilliard sextilliard 1e39 sextillion sextillion 1e21 sextillionth sextillionth 1e-21 sextillionths sextillionths 1e-21 trilliard trilliard 1e21 trillion trillion 1e12 trillionth trillionth 1e-12 trillionths trillionths 1e-12

Angles[change source]

%  % Percent ANGLE 0.01 percent  % Percent ANGLE 0.01 per cent  % Percent ANGLE 0.01 ‰ ‰ Per mil ANGLE 1e-3 per mil ‰ Per mil ANGLE 1e-3 per mill ‰ Per mil ANGLE 1e-3 per mille ‰ Per mil ANGLE 1e-3 permil ‰ Per mil ANGLE 1e-3 permill ‰ Per mil ANGLE 1e-3 permille ‰ Per mil ANGLE 1e-3 ° ° Degree (angle) ANGLE pi/180 deg ° Degree (angle) ANGLE pi/180 ' ′ Minute of arc ANGLE pi/10800 ′ ′ Minute of arc ANGLE pi/10800 arcmin ′ Minute of arc ANGLE pi/10800 arcminute ′ Minute of arc ANGLE pi/10800 " ″ Second of arc ANGLE pi/648000 ″ ″ Second of arc ANGLE pi/648000 arcsec ″ Second of arc ANGLE pi/648000 arcsecond ″ Second of arc ANGLE pi/648000 mas mas pi/648000000

]=]

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

Long scale numbers and phrases[change source]

billion billion 1e12 billionth billionth 1e-12 billionths billionths 1e-12 decillion decillion 1e60 decillionth decillionth 1e-60 decillionths decillionths 1e-60 nonillion nonillion 1e54 nonillionth nonillionth 1e-54 nonillionths nonillionths 1e-54 octillion octillion 1e48 octillionth octillionth 1e-48 octillionths octillionths 1e-48 quadrillion quadrillion 1e24 quadrillionth quadrillionth 1e-24 quadrillionths quadrillionths 1e-24 quintillion quintillion 1e30 quintillionth quintillionth 1e-30 quintillionths quintillionths 1e-30 septillion septillion 1e42 septillionth septillionth 1e-42 septillionths septillionths 1e-42 sextillion sextillion 1e36 sextillionth sextillionth 1e-36 sextillionths sextillionths 1e-36 trillion trillion 1e18 trillionth trillionth 1e-18 trillionths trillionths 1e-18

]=]

return { builtin_units = builtin_units, builtin_units_long_scale = builtin_units_long_scale }

{{val/units|whatever}}  → 

-- Definitions for units known to val -- File format is two strings and a return statement with them in it: -- string in quotes [=[ ... builtin_units ... ]=]. -- string in quotes [=[ ... builtin_units_long_scale ... ]=]. -- First string, builtin_units, is short-scale, second string is long scale.

-- Entry format: -- One record per line, starting in first column, having 2-4 fields. -- Field separator: two or more spaces -- Between first and second fields: two or more spaces -- Between all other fields: two or more spaces, or one or more tabs -- Entries without two spaces in them are ignored.

-- There must be a blank line before the first entry and after the last. -- I.e. the first two and last two characters of the string must be newlines.

-- Format of entry. Two record types: -- -- One record type is a wikilink: -- Unit-code Symbol-accepts-HTML-only -- Text-field separator is still two spaces. Two spaces not allowed in wikilink. -- -- The other record type is all fields: -- Unit-code symbol-accepts-HTML-only pagename#section-OK -- -- Plus there is an optional field that goes at the end after two or more spaces. -- Whether it is a number or an equation or the letters SI, -- any of these three has the same function: a wikitable sorting "scale". -- It is for sorting, and it works for either record type. -- Difference is SI can't accept HTML. But SI correctly scales any SI prefix. -- (Optional fields ALIAS and NOSPACE and ANGLE are for advanced users.)

-- "Invalid unit" error: -- Using SI requires that the symbol equal unit-code, so never allows HTML. -- Any difference between SI or symbol must be an SI prefix, such as k, M, or G. -- A space at the end of an entry is an error. No space at each EOL.

local builtin_units = [=[

Test[change source]

Foo Foo Baz baz0 Baz baz0 Bar bar0 quux bar0

Unsorted units[change source]

c0 c0 lbf lbF N.s N⋅s J.K-1 J⋅K−1 C.mol-1 C⋅mol−1 C/mol C/mol C.kg-1 C⋅kg−1 C/kg C/kg F.m-1 F⋅m−1 F/m F/m e e kB kB 8e3 KB KB 8e3 MB MB 8e6 GB GB 8e9 TB TB 8e12 lx lx nat nat

Time and frequency[change source]

byte/s byte/s 8 kB/s kB/s 8e3 MB/s MB/s 8e6 GB/s GB/s 8e9 TB/s TB/s 8e12 bit/s bit/s 1 bps bit/s 1 kbit/s kbit/s 1e3 Mbit/s Mbit/s 1e6 Gbit/s Gbit/s 1e9 Tbit/s Tbit/s 1e12 kT/s kT/s 1e3 MT/s MT/s 1e6 GT/s GT/s 1e9 year year 31557600 years years 31557600 yr yr 31557600 y y 31557600 a a 31557600 Ga Ga 31557600000000000 Ma Ma 31557600000000 ka ka 31557600000 kyr kyr 31557600000 kya kya 31557600000 myr myr 31557600000000 mya mya 31557600000000 byr byr 31557600000000000 bya bya 31557600000000000 Gyr Gyr 31557600000000000 BP BP uBP 14C yr BP BC BC -1 AD AD 1 BCE BCE -1 CE CE 1 JD JD 1 MJD MJD 1

s-1 s−1 s-2 s−2 s2 s2

s s SI as s SI cs s SI das s SI ds s SI Es s SI fs s SI Gs s SI hs s SI ks s SI ms s SI µs s SI us s SI Ms s SI ns s SI ps s SI Ps s SI Ts s SI Ys s SI ys s SI Zs s SI zs s SI

Hz Hz SI aHz Hz SI cHz Hz SI daHz Hz SI dHz Hz SI EHz Hz SI fHz Hz SI hHz Hz SI GHz Hz SI kHz Hz SI MHz Hz SI mHz Hz SI uHz Hz SI µHz Hz SI nHz Hz SI pHz Hz SI PHz Hz SI THz Hz SI yHz Hz SI YHz Hz SI zHz Hz SI ZHz Hz SI

ips ips

Length, area, volume[change source]

Å3 Å3 fb-1 fb−1 m-1 m−1 m-2 m−2 m-3 m−3 km2 km2 km3 km3 µm2 µm2 um2 µm2 am2 am2 cm2 cm2 dam2 dam2 dm2 dm2 Em2 Em2 fm2 fm2 Gm2 Gm2 hm2 hm2 mm2 mm2 Mm2 Mm2 nm2 nm2 pm2 pm2 Pm2 Pm2 Tm2 Tm2 ym2 ym2 Ym2 Ym2 zm2 zm2 Zm2 Zm2 gal gal Gal Gal uGal µGal µGal µGal mGal mGal

b b SI ab b SI cb b SI dab b SI db b SI Eb b SI fb b SI Gb b SI hb b SI kb b SI mb b SI µb b SI ub b SI Mb b SI nb b SI pb b SI Pb b SI Tb b SI Yb b SI yb b SI Zb b SI zb b SI

Velocity and acceleration[change source]

m.s-2 m⋅s−2 m/s2 m/s2 m.s-1 m⋅s−1 m/s m/s km.s-1 km⋅s−1 km/s km/s

Mass and energy[change source]

lbm lbm uJ µJ J.s J⋅s kWh kWh kW.h kW⋅h J/C J/C J/kg J/kg

Da Da SI EDa Da SI PDa Da SI TDa Da SI GDa Da SI MDa Da SI kDa Da SI mDa Da SI uDa Da SI μDa Da SI nDa Da SI pDa Da SI fDa Da SI aDa Da SI

g g SI ag g SI cg g SI dag g SI dg g SI Eg g SI fg g SI Gg g SI hg g SI kg g SI mcg g SI Mg g SI mg g SI ug g SI µg g SI ng g SI Pg g SI pg g SI Tg g SI yg g SI Yg g SI zg g SI Zg g SI

Pressure and density[change source]

psi psi g.cm-3 g⋅cm−3 g/cm3 g/cm3 kg.m-3 kg⋅m−3 kg/m3 kg/m3 kg/cm3 kg/cm3 g/L g/L g/l g/l mcg/dL µg/dL mcg/dl µg/dl mg/mL mg/mL mg/ml mg/ml ug/dL µg/dL ug/dl µg/dl μg/dL μg/dL μg/dl μg/dl mg.L-1 mg/L mg/L mg/L mg.l-1 mg/l mg/l mg/l

Fracture toughness[change source]

MPa.m.5 MPa⋅m1/2 kPa.m.5 kPa⋅m1/2 Pa.m.5 Pa⋅m1/2

Temperature[change source]

degC °C ALIAS degF °F ALIAS degR °R ALIAS

K K SI YK K SI ZK K SI EK K SI PK K SI TK K SI GK K SI MK K SI kK K SI hK K SI daK K SI dK K SI cK K SI mK K SI µK K SI uK K SI nK K SI pK K SI fK K SI aK K SI zK K SI yK K SI

Electromagnetism[change source]

Wb Wb N.A-2 N⋅A−2 H.m-1 H⋅m−1 V.m-1 V⋅m−1 V/m V/m

C C SI YC C SI ZC C SI EC C SI PC C SI TC C SI GC C SI MC C SI kC C SI hC C SI daC C SI dC C SI cC C SI mC C SI µC C SI uC C SI nC C SI pC C SI fC C SI aC C SI zC C SI yC C SI

F F SI YF F SI ZF F SI EF F SI PF F SI TF F SI GF F SI MF F SI kF F SI hF F SI daF F SI dF F SI cF F SI mF F SI µF F SI uF F SI nF F SI pF F SI fF F SI aF F SI zF F SI yF F SI

H H SI YH H SI ZH H SI EH H SI PH H SI TH H SI GH H SI MH H SI kH H SI hH H SI daH H SI dH H SI cH H SI mH H SI µH H SI uH H SI nH H SI pH H SI fH H SI aH H SI zH H SI yH H SI

A A SI YA A SI ZA A SI EA A SI PA A SI TA A SI GA A SI MA A SI kA A SI hA A SI daA A SI dA A SI cA A SI mA A SI µA A SI uA A SI nA A SI pA A SI fA A SI aA A SI zA A SI yA A SI

V V SI YV V SI ZV V SI EV V SI PV V SI TV V SI GV V SI MV V SI kV V SI hV V SI daV V SI dV V SI cV V SI mV V SI µV V SI uV V SI nV V SI pV V SI fV V SI aV V SI zV V SI yV V SI

VA VA SI YVA VA SI ZVA VA SI EVA VA SI PVA VA SI TVA VA SI GVA VA SI MVA VA SI kVA VA SI hVA VA SI daVA VA SI dVA VA SI cVA VA SI mVA VA SI µVA VA SI uVA VA SI nVA VA SI pVA VA SI fVA VA SI aVA VA SI zVA VA SI yVA VA SI

Ω Ω SI

YΩ.m YΩ⋅m 1e24 ZΩ.m ZΩ⋅m 1e21 EΩ.m EΩ⋅m 1e18 PΩ.m PΩ⋅m 1e15 TΩ.m TΩ⋅m 1e12 GΩ.m GΩ⋅m 1e9 MΩ.m MΩ⋅m 1e6 kΩ.m kΩ⋅m 1e3 Ω.m Ω⋅m 1 mΩ.m mΩ⋅m 1e-3 µΩ.m µΩ⋅m 1e-6 uΩ.m µΩ⋅m 1e-6 nΩ.m nΩ⋅m 1e-9 pΩ.m pΩ⋅m 1e-12 fΩ.m fΩ⋅m 1e-15 aΩ.m aΩ⋅m 1e-18 zΩ.m zΩ⋅m 1e-21 yΩ.m yΩ⋅m 1e-24

R R SI

G G SI aG G SI cG G SI daG G SI dG G SI EG G SI fG G SI GG G SI hG G SI kG G SI MG G SI mG G SI uG G SI µG G SI nG G SI PG G SI pG G SI TG G SI yG G SI YG G SI zG G SI ZG G SI

T T SI aT T SI cT T SI daT T SI dT T SI ET T SI fT T SI GT T SI hT T SI kT T SI MT T SI mT T SI uT T SI µT T SI nT T SI PT T SI pT T SI TT T SI yT T SI YT T SI zT T SI ZT T SI

Astrophysics[change source]

au au c c ly ly dex dex Earth mass M🜨 Earth radius R🜨 M_Earth M🜨 R_Earth R🜨 M+ M🜨 R+ R🜨 Jupiter mass MJ Jupiter radius RJ Jy Jy M_Jupiter MJ R_Jupiter RJ Solar mass M solar mass M M_Solar M M_solar M R_Solar R R_solar R Solar radius R solar radius R Solar luminosity L solar luminosity L L_solar L L_Solar L Lo L pc2 pc2 pc3 pc3 kpc2 kpc2 kpc3 kpc3 kpc kpc Mpc2 Mpc2 Mpc3 Mpc3 Mpc Mpc Gpc2 Gpc2 Gpc3 Gpc3 Gpc Gpc

Nuclear physics and chemistry[change source]

cm-1 cm−1 u u osmol osmol Osm Osm M M TM M SI GM M SI MM M SI kM M SI hM M SI daM M SI dM M SI cM M SI mM M SI uM M 1e-6 nM M SI pM M SI kg.mol-1 kg⋅mol−1 kg/mol kg/mol g.mol-1 g⋅mol−1 g/mol g/mol eV/c2 eV/c2 keV/c2 keV/c2 MeV/c2 MeV/c2 GeV/c2 GeV/c2 TeV/c2 TeV/c2 eV eV meV meV keV keV MeV MeV GeV GeV TeV TeV mol-1 mol−1 J.mol-1 J⋅mol−1 J/mol J/mol kJ.mol-1 kJ⋅mol−1 kJ/mol kJ/mol MJ.mol-1 MJ⋅mol−1 MJ/mol MJ/mol GJ.mol-1 GJ⋅mol−1 GJ/mol GJ/mol TJ.mol-1 TJ⋅mol−1 TJ/mol TJ/mol

Numbers and phrases[change source]

pp pp ppb ppb 1e-9 ppm ppm 1e-6 billiard billiard 1e15 billion billion 1e9 billionth billionth 1e-9 billionths billionths 1e-9 decilliard decilliard 1e63 decillion decillion 1e33 decillionth decillionth 1e-33 decillionths decillionths 1e-33 milliard milliard 1e9 million million 1e6 millionth millionth 1e-6 millionths millionths 1e-6 nonilliard nonilliard 1e57 nonillion nonillion 1e30 nonillionth nonillionth 1e-30 nonillionths nonillionths 1e-30 octilliard octilliard 1e51 octillion octillion 1e27 octillionth octillionth 1e-27 octillionths octillionths 1e-27 quadrilliard quadrilliard 1e27 quadrillion quadrillion 1e15 quadrillionth quadrillionth 1e-15 quadrillionths quadrillionths 1e-15 quintilliard quintilliard 1e33 quintillion quintillion 1e18 quintillionth quintillionth 1e-18 quintillionths quintillionths 1e-18 septilliard septilliard 1e45 septillion septillion 1e24 septillionth septillionth 1e-24 septillionths septillionths 1e-24 sextilliard sextilliard 1e39 sextillion sextillion 1e21 sextillionth sextillionth 1e-21 sextillionths sextillionths 1e-21 trilliard trilliard 1e21 trillion trillion 1e12 trillionth trillionth 1e-12 trillionths trillionths 1e-12

Angles[change source]

%  % Percent ANGLE 0.01 percent  % Percent ANGLE 0.01 per cent  % Percent ANGLE 0.01 ‰ ‰ Per mil ANGLE 1e-3 per mil ‰ Per mil ANGLE 1e-3 per mill ‰ Per mil ANGLE 1e-3 per mille ‰ Per mil ANGLE 1e-3 permil ‰ Per mil ANGLE 1e-3 permill ‰ Per mil ANGLE 1e-3 permille ‰ Per mil ANGLE 1e-3 ° ° Degree (angle) ANGLE pi/180 deg ° Degree (angle) ANGLE pi/180 ' ′ Minute of arc ANGLE pi/10800 ′ ′ Minute of arc ANGLE pi/10800 arcmin ′ Minute of arc ANGLE pi/10800 arcminute ′ Minute of arc ANGLE pi/10800 " ″ Second of arc ANGLE pi/648000 ″ ″ Second of arc ANGLE pi/648000 arcsec ″ Second of arc ANGLE pi/648000 arcsecond ″ Second of arc ANGLE pi/648000 mas mas pi/648000000

]=]

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

Long scale numbers and phrases[change source]

billion billion 1e12 billionth billionth 1e-12 billionths billionths 1e-12 decillion decillion 1e60 decillionth decillionth 1e-60 decillionths decillionths 1e-60 nonillion nonillion 1e54 nonillionth nonillionth 1e-54 nonillionths nonillionths 1e-54 octillion octillion 1e48 octillionth octillionth 1e-48 octillionths octillionths 1e-48 quadrillion quadrillion 1e24 quadrillionth quadrillionth 1e-24 quadrillionths quadrillionths 1e-24 quintillion quintillion 1e30 quintillionth quintillionth 1e-30 quintillionths quintillionths 1e-30 septillion septillion 1e42 septillionth septillionth 1e-42 septillionths septillionths 1e-42 sextillion sextillion 1e36 sextillionth sextillionth 1e-36 sextillionths sextillionths 1e-36 trillion trillion 1e18 trillionth trillionth 1e-18 trillionths trillionths 1e-18

]=]

return { builtin_units = builtin_units, builtin_units_long_scale = builtin_units_long_scale }

How to add units[change source]

To add a unit, or reconfigure one, or to override or repair a unit's linking or markup behavior, edit a section and follow the existing formats in the wikitext, staying inside the closest surrounding pairs of onlyinclude tags.

If you're in a hurry you can just

  • add to § Unsorted units below,
  • "Show preview" as the test, and
  • "Show Changes" as the proof that any changes were intended and accurate, in order to prevent accidents on other pages.

(If you're not in a hurry, you may notice undocumented, extra template code.)

Decide on a keyboard-friendly unit code for the new unit. If it is not obvious, see RFC1345 and the references at the bottom of this page.
|unit code = [[Article|markup]]

  1. Start the placement of the new val/units element, inside onlyinclude tags. The opening tag is <onlyinclude> and the closing tag is </onlyinclude>. Do not add these tags yourself unless you are reorganizing the sections. Each section has one pair, and if it has commentary that renders on the, there is another set of onlyinclude tags.
  2. For multiplication use an &sdot;. For division use the slash or the unit-inversion form.
  3. Consider adding aliases[1] (markup variations) for:
    • capitalization—they're case sensitive
    • division—the -2 version for inverse squared, etc., so we end up with both the slash a/b and inversion ab−1 forms. For example, when adding a unit like m/s, add the m⋅s−1 version as well.
    • multiplication—the* version.
  4. Format the line like the others. The sequence—extra whitespace is allowed between parts—is:
    • a pipe character |
    • the unit code
    • the equals sign =
    • the link
  5. Show preview to test the appearance.
    • Prove the intended link from the preview. Could it better link to a subsection?
    • Hover the mouse over the link, and read the hover-card or, JavaScript popup, or URL display somewhere in the browser, and see the article title. Does the hover reaction help by hinting about the unit? If it just repeats information, this may mean creating a redirect that will spell out the unit.[2]
    • Is your rendered markup compliant with the Manual of Style?
  6. Show changes to prove no inadvertent changes accidentally occurred.
  7. Save the page. Saving the page activates the changes immediately, and they go live. You're done adding your unit.

Eventually all new units are added to Template:Val/units/testcases. Go ahead and add it yourself if you'd like.[3]

If you want a unit to add for practice, add one from List of common physics notations, or from SI units#Units and prefixes.

Non-spaced units[change source]

These dimensionless units are not part of {{Val/units}} for technical reasons related to the markup for uncertainty notations. A non-spaced unit follows its numeric value without the usual space. To configure these, edit the template for Non-spaced units:

  • arcsecond|arcsec|" =
  • arcminute|arcmin|'|′ =
  • deg|° = °
  • percent|per cent|% = %
  • permil|permill|permille|per mil|per mill|per mille|‰ =

Notes[change source]

  1. For unit code a aliases b and c this config file does understand OR as in a OR b or C in the format "a|b|c = [markup", but a single unit code per line is a preferable format for writing a script to generating a test suite for the unit codes sytem
  2. A redirect page is easy to make; there are tools on the editor toolbars.
  3. Testcases for this template are a side-by-side test, with the live and sandbox versions of this template.