From 8b51395b723bb86ca129ea2b0f281da554366559 Mon Sep 17 00:00:00 2001 From: Mike Boutin Date: Sun, 19 Mar 2017 15:38:57 -0400 Subject: [PATCH] Change syntax for unit abbreviation and description. --- examples/mks.rs | 8 +++--- src/si/amount_of_substance.rs | 40 ++++++++++++++--------------- src/si/electric_current.rs | 40 ++++++++++++++--------------- src/si/length.rs | 40 ++++++++++++++--------------- src/si/luminous_intensity.rs | 40 ++++++++++++++--------------- src/si/mass.rs | 40 ++++++++++++++--------------- src/si/thermodynamic_temperature.rs | 40 ++++++++++++++--------------- src/si/time.rs | 40 ++++++++++++++--------------- src/si/velocity.rs | 40 ++++++++++++++--------------- src/system.rs | 26 +++++++++---------- 10 files changed, 177 insertions(+), 177 deletions(-) diff --git a/examples/mks.rs b/examples/mks.rs index 4c2629e8..cc3da582 100644 --- a/examples/mks.rs +++ b/examples/mks.rs @@ -30,8 +30,8 @@ mod length { Z0, // mass Z0>; // time units { - @meter: 1.0E0; "m"; "meter"; "meters"; - @foot: 3.048E-1; "ft"; "foot"; "feet"; + @meter: 1.0E0; "m", "meter", "meters"; + @foot: 3.048E-1; "ft", "foot", "feet"; } } } @@ -47,7 +47,7 @@ mod mass { P1, // mass Z0>; // time units { - @kilogram: 1.0; "kg"; "kilogram"; "kilograms"; + @kilogram: 1.0; "kg", "kilogram", "kilograms"; } } } @@ -63,7 +63,7 @@ mod time { Z0, // mass P1>; // time units { - @second: 1.0; "s"; "second"; "seconds"; + @second: 1.0; "s", "second", "seconds"; } } } diff --git a/src/si/amount_of_substance.rs b/src/si/amount_of_substance.rs index 9ac109b0..4b24203f 100644 --- a/src/si/amount_of_substance.rs +++ b/src/si/amount_of_substance.rs @@ -13,29 +13,29 @@ quantity! { P1, // amount of substance Z0>; // luminous intensity units { - @yottamole: prefix!(yotta); "Ymol"; "yottamole"; "yottamoles"; - @zettamole: prefix!(zetta); "Zmol"; "zettamole"; "zettamoles"; - @examole: prefix!(exa); "Emol"; "examole"; "examoles"; - @petamole: prefix!(peta); "Pmol"; "petamole"; "petamoles"; - @teramole: prefix!(tera); "Tmol"; "teramole"; "teramoles"; - @megamole: prefix!(mega); "Mmol"; "megamole"; "megamoles"; - @kilomole: prefix!(kilo); "kmol"; "kilomole"; "kilomoles"; - @hectomole: prefix!(hecto); "hmol"; "hectomole"; "hectomoles"; - @decamole: prefix!(deca); "damol"; "decamole"; "decamoles"; + @yottamole: prefix!(yotta); "Ymol", "yottamole", "yottamoles"; + @zettamole: prefix!(zetta); "Zmol", "zettamole", "zettamoles"; + @examole: prefix!(exa); "Emol", "examole", "examoles"; + @petamole: prefix!(peta); "Pmol", "petamole", "petamoles"; + @teramole: prefix!(tera); "Tmol", "teramole", "teramoles"; + @megamole: prefix!(mega); "Mmol", "megamole", "megamoles"; + @kilomole: prefix!(kilo); "kmol", "kilomole", "kilomoles"; + @hectomole: prefix!(hecto); "hmol", "hectomole", "hectomoles"; + @decamole: prefix!(deca); "damol", "decamole", "decamoles"; /// 1. The mole is the amount of substance of a system which contains as many elementary /// entities as there are atoms in 0.012 kilogram of carbon 12. /// 2. When the mole is used, the elementary entities must be specified and may be atmons, /// molecules, ions, electrons, other particles, or specified groups of such particles. - @mole: prefix!(none); "mol"; "mole"; "moles"; - @decimole: prefix!(deci); "dmol"; "decimole"; "decimoles"; - @centimole: prefix!(centi); "cmol"; "centimole"; "centimoles"; - @millimole: prefix!(milli); "mmol"; "millimole"; "millimoles"; - @micromole: prefix!(micro); "µmol"; "micromole"; "micromoles"; - @nanomole: prefix!(nano); "nmol"; "nanomole"; "nanomoles"; - @picomole: prefix!(pico); "pmol"; "picomole"; "picomoles"; - @femtomole: prefix!(femto); "fmol"; "femtomole"; "femtomoles"; - @attomole: prefix!(atto); "amol"; "attomole"; "attomoles"; - @zeptomole: prefix!(zepto); "zmol"; "zeptomole"; "zeptomoles"; - @yoctomole: prefix!(yocto); "ymol"; "yoctomole"; "yoctomoles"; + @mole: prefix!(none); "mol", "mole", "moles"; + @decimole: prefix!(deci); "dmol", "decimole", "decimoles"; + @centimole: prefix!(centi); "cmol", "centimole", "centimoles"; + @millimole: prefix!(milli); "mmol", "millimole", "millimoles"; + @micromole: prefix!(micro); "µmol", "micromole", "micromoles"; + @nanomole: prefix!(nano); "nmol", "nanomole", "nanomoles"; + @picomole: prefix!(pico); "pmol", "picomole", "picomoles"; + @femtomole: prefix!(femto); "fmol", "femtomole", "femtomoles"; + @attomole: prefix!(atto); "amol", "attomole", "attomoles"; + @zeptomole: prefix!(zepto); "zmol", "zeptomole", "zeptomoles"; + @yoctomole: prefix!(yocto); "ymol", "yoctomole", "yoctomoles"; } } diff --git a/src/si/electric_current.rs b/src/si/electric_current.rs index e5b70436..05d28aeb 100644 --- a/src/si/electric_current.rs +++ b/src/si/electric_current.rs @@ -13,29 +13,29 @@ quantity! { Z0, // amount of substance Z0>; // luminous intensity units { - @yottaampere: prefix!(yotta); "YA"; "yottaampere"; "yottaamperes"; - @zettaampere: prefix!(zetta); "ZA"; "zettaampere"; "zettaamperes"; - @exaampere: prefix!(exa); "EA"; "exaampere"; "exaamperes"; - @petaampere: prefix!(peta); "PA"; "petaampere"; "petaamperes"; - @teraampere: prefix!(tera); "TA"; "teraampere"; "teraamperes"; - @megaampere: prefix!(mega); "MA"; "megaampere"; "megaamperes"; - @kiloampere: prefix!(kilo); "kA"; "kiloampere"; "kiloamperes"; - @hectoampere: prefix!(hecto); "hA"; "hectoampere"; "hectoamperes"; - @decaampere: prefix!(deca); "daA"; "decaampere"; "decaamperes"; + @yottaampere: prefix!(yotta); "YA", "yottaampere", "yottaamperes"; + @zettaampere: prefix!(zetta); "ZA", "zettaampere", "zettaamperes"; + @exaampere: prefix!(exa); "EA", "exaampere", "exaamperes"; + @petaampere: prefix!(peta); "PA", "petaampere", "petaamperes"; + @teraampere: prefix!(tera); "TA", "teraampere", "teraamperes"; + @megaampere: prefix!(mega); "MA", "megaampere", "megaamperes"; + @kiloampere: prefix!(kilo); "kA", "kiloampere", "kiloamperes"; + @hectoampere: prefix!(hecto); "hA", "hectoampere", "hectoamperes"; + @decaampere: prefix!(deca); "daA", "decaampere", "decaamperes"; /// The ampere is the constant current which, if maintained in two straight parallel /// conductors of infinite length, of negligible circular cross-section, and placed 1 meter /// apart in vacuum, would produce between these conductors a force equal to 2E-7 newton per /// meter of length. - @ampere: prefix!(none); "A"; "ampere"; "amperes"; - @deciampere: prefix!(deci); "dA"; "deciampere"; "deciamperes"; - @centiampere: prefix!(centi); "cA"; "centiampere"; "centiamperes"; - @milliampere: prefix!(milli); "mA"; "millampere"; "millamperes"; - @microampere: prefix!(micro); "A"; "ampere"; "amperes"; - @nanoampere: prefix!(nano); "A"; "ampere"; "amperes"; - @picoampere: prefix!(pico); "A"; "ampere"; "amperes"; - @femtoampere: prefix!(femto); "A"; "ampere"; "amperes"; - @attoampere: prefix!(atto); "A"; "ampere"; "amperes"; - @zeptoampere: prefix!(zepto); "A"; "ampere"; "amperes"; - @yoctoampere: prefix!(yocto); "A"; "ampere"; "amperes"; + @ampere: prefix!(none); "A", "ampere", "amperes"; + @deciampere: prefix!(deci); "dA", "deciampere", "deciamperes"; + @centiampere: prefix!(centi); "cA", "centiampere", "centiamperes"; + @milliampere: prefix!(milli); "mA", "millampere", "millamperes"; + @microampere: prefix!(micro); "A", "ampere", "amperes"; + @nanoampere: prefix!(nano); "A", "ampere", "amperes"; + @picoampere: prefix!(pico); "A", "ampere", "amperes"; + @femtoampere: prefix!(femto); "A", "ampere", "amperes"; + @attoampere: prefix!(atto); "A", "ampere", "amperes"; + @zeptoampere: prefix!(zepto); "A", "ampere", "amperes"; + @yoctoampere: prefix!(yocto); "A", "ampere", "amperes"; } } diff --git a/src/si/length.rs b/src/si/length.rs index cfaa2e8d..bc80331c 100644 --- a/src/si/length.rs +++ b/src/si/length.rs @@ -13,27 +13,27 @@ quantity! { Z0, // amount of substance Z0>; // luminous intensity units { - @yottameter: prefix!(yotta); "Ym"; "yottameter"; "yottameters"; - @zettameter: prefix!(zetta); "Zm"; "zettameter"; "zettameters"; - @exameter: prefix!(exa); "Em"; "exameter"; "exameters"; - @petameter: prefix!(peta); "Pm"; "petameter"; "petameters"; - @terameter: prefix!(tera); "Tm"; "terameter"; "terameters"; - @megameter: prefix!(mega); "Mm"; "megameter"; "megameters"; - @kilometer: prefix!(kilo); "km"; "kilometer"; "kilometers"; - @hectometer: prefix!(hecto); "hm"; "hectometer"; "hectometers"; - @decameter: prefix!(deca); "dam"; "decameter"; "decameters"; + @yottameter: prefix!(yotta); "Ym", "yottameter", "yottameters"; + @zettameter: prefix!(zetta); "Zm", "zettameter", "zettameters"; + @exameter: prefix!(exa); "Em", "exameter", "exameters"; + @petameter: prefix!(peta); "Pm", "petameter", "petameters"; + @terameter: prefix!(tera); "Tm", "terameter", "terameters"; + @megameter: prefix!(mega); "Mm", "megameter", "megameters"; + @kilometer: prefix!(kilo); "km", "kilometer", "kilometers"; + @hectometer: prefix!(hecto); "hm", "hectometer", "hectometers"; + @decameter: prefix!(deca); "dam", "decameter", "decameters"; /// The meter is the length of the path travelled by light in a vacuum during a time /// interval of 1/299 792 458 of a second. - @meter: prefix!(none); "m"; "meter"; "meters"; - @decimeter: prefix!(deci); "dm"; "decimeter"; "decimeters"; - @centimeter: prefix!(centi); "cm"; "centimeter"; "centimeters"; - @millimeter: prefix!(milli); "mm"; "millimeter"; "millimeters"; - @micrometer: prefix!(micro); "µm"; "micrometer"; "micrometers"; - @nanometer: prefix!(nano); "nm"; "nanometer"; "nanometers"; - @picometer: prefix!(pico); "pm"; "picometer"; "picometers"; - @femtometer: prefix!(femto); "fm"; "femtometer"; "femtometers"; - @attometer: prefix!(atto); "am"; "attometer"; "attometers"; - @zeptometer: prefix!(zepto); "zm"; "zeptometer"; "zeptometers"; - @yoctometer: prefix!(yocto); "ym"; "yoctometer"; "yoctometers"; + @meter: prefix!(none); "m", "meter", "meters"; + @decimeter: prefix!(deci); "dm", "decimeter", "decimeters"; + @centimeter: prefix!(centi); "cm", "centimeter", "centimeters"; + @millimeter: prefix!(milli); "mm", "millimeter", "millimeters"; + @micrometer: prefix!(micro); "µm", "micrometer", "micrometers"; + @nanometer: prefix!(nano); "nm", "nanometer", "nanometers"; + @picometer: prefix!(pico); "pm", "picometer", "picometers"; + @femtometer: prefix!(femto); "fm", "femtometer", "femtometers"; + @attometer: prefix!(atto); "am", "attometer", "attometers"; + @zeptometer: prefix!(zepto); "zm", "zeptometer", "zeptometers"; + @yoctometer: prefix!(yocto); "ym", "yoctometer", "yoctometers"; } } diff --git a/src/si/luminous_intensity.rs b/src/si/luminous_intensity.rs index 3847ef46..7a4bae1a 100644 --- a/src/si/luminous_intensity.rs +++ b/src/si/luminous_intensity.rs @@ -13,28 +13,28 @@ quantity! { Z0, // amount of substance P1>; // luminous intensity units { - @yottacandela: prefix!(yotta); "Ycd"; "yottacandela"; "yottacandelas"; - @zettacandela: prefix!(zetta); "Zcd"; "zettacandela"; "zettacandelas"; - @exacandela: prefix!(exa); "Ecd"; "exacandela"; "exacandelas"; - @petacandela: prefix!(peta); "Pcd"; "petacandela"; "petacandelas"; - @teracandela: prefix!(tera); "Tcd"; "teracandela"; "teracandelas"; - @megacandela: prefix!(mega); "Mcd"; "megacandela"; "megacandelas"; - @kilocandela: prefix!(kilo); "kcd"; "kilocandela"; "kilocandelas"; - @hectocandela: prefix!(hecto); "hcd"; "hectocandela"; "hectocandelas"; - @decacandela: prefix!(deca); "dacd"; "decacandela"; "decacandelas"; + @yottacandela: prefix!(yotta); "Ycd", "yottacandela", "yottacandelas"; + @zettacandela: prefix!(zetta); "Zcd", "zettacandela", "zettacandelas"; + @exacandela: prefix!(exa); "Ecd", "exacandela", "exacandelas"; + @petacandela: prefix!(peta); "Pcd", "petacandela", "petacandelas"; + @teracandela: prefix!(tera); "Tcd", "teracandela", "teracandelas"; + @megacandela: prefix!(mega); "Mcd", "megacandela", "megacandelas"; + @kilocandela: prefix!(kilo); "kcd", "kilocandela", "kilocandelas"; + @hectocandela: prefix!(hecto); "hcd", "hectocandela", "hectocandelas"; + @decacandela: prefix!(deca); "dacd", "decacandela", "decacandelas"; /// The candela is the luminous intensity, in a given direction, of a source that emits /// monochromatic radiation of frequency 540 × 10^(12) hertz and that has radiant intensity /// in that direction of 1/683 watt per steradian. - @candela: prefix!(none); "cd"; "candela"; "candelas"; - @decicandela: prefix!(deci); "dcd"; "decicandela"; "decicandelas"; - @centicandela: prefix!(centi); "ccd"; "centicandela"; "centicandelas"; - @millicandela: prefix!(milli); "mcd"; "millicandela"; "millicandelas"; - @microcandela: prefix!(micro); "mcd"; "microcandela"; "microcandelas"; - @nanocandela: prefix!(nano); "ncd"; "nanocandela"; "nanocandelas"; - @picocandela: prefix!(pico); "pcd"; "picocandela"; "picocandelas"; - @femtocandela: prefix!(femto); "fcd"; "femtocandela"; "femtocandelas"; - @attocandela: prefix!(atto); "acd"; "attocandela"; "attocandelas"; - @zeptocandela: prefix!(zepto); "zcd"; "zeptocandela"; "zeptocandelas"; - @yoctocandela: prefix!(yocto); "ycd"; "yoctocandela"; "yoctocandelas"; + @candela: prefix!(none); "cd", "candela", "candelas"; + @decicandela: prefix!(deci); "dcd", "decicandela", "decicandelas"; + @centicandela: prefix!(centi); "ccd", "centicandela", "centicandelas"; + @millicandela: prefix!(milli); "mcd", "millicandela", "millicandelas"; + @microcandela: prefix!(micro); "mcd", "microcandela", "microcandelas"; + @nanocandela: prefix!(nano); "ncd", "nanocandela", "nanocandelas"; + @picocandela: prefix!(pico); "pcd", "picocandela", "picocandelas"; + @femtocandela: prefix!(femto); "fcd", "femtocandela", "femtocandelas"; + @attocandela: prefix!(atto); "acd", "attocandela", "attocandelas"; + @zeptocandela: prefix!(zepto); "zcd", "zeptocandela", "zeptocandelas"; + @yoctocandela: prefix!(yocto); "ycd", "yoctocandela", "yoctocandelas"; } } diff --git a/src/si/mass.rs b/src/si/mass.rs index 8015f3ba..6218284c 100644 --- a/src/si/mass.rs +++ b/src/si/mass.rs @@ -13,27 +13,27 @@ quantity! { Z0, // amount of substance Z0>; // luminous intensity units { - @yottagram: prefix!(yotta) / prefix!(kilo); "Yg"; "yottagram"; "yottagrams"; - @zettagram: prefix!(zetta) / prefix!(kilo); "Zg"; "zettagram"; "zettagrams"; - @exagram: prefix!(exa) / prefix!(kilo); "Eg"; "exagram"; "exagrams"; - @petagram: prefix!(peta) / prefix!(kilo); "Pg"; "petagram"; "petagrams"; - @teragram: prefix!(tera) / prefix!(kilo); "Tg"; "teragram"; "teragrams"; - @megagram: prefix!(mega) / prefix!(kilo); "Mg"; "megagram"; "megagrams"; + @yottagram: prefix!(yotta) / prefix!(kilo); "Yg", "yottagram", "yottagrams"; + @zettagram: prefix!(zetta) / prefix!(kilo); "Zg", "zettagram", "zettagrams"; + @exagram: prefix!(exa) / prefix!(kilo); "Eg", "exagram", "exagrams"; + @petagram: prefix!(peta) / prefix!(kilo); "Pg", "petagram", "petagrams"; + @teragram: prefix!(tera) / prefix!(kilo); "Tg", "teragram", "teragrams"; + @megagram: prefix!(mega) / prefix!(kilo); "Mg", "megagram", "megagrams"; /// The kilogram is the unit of mass; it is equal to the mass of the international prototype /// of the kilogram. - @kilogram: prefix!(kilo) / prefix!(kilo); "kg"; "kilogram"; "kilograms"; - @hectogram: prefix!(hecto) / prefix!(kilo); "hg"; "hectogram"; "hectograms"; - @decagram: prefix!(deca) / prefix!(kilo); "dag"; "decagram"; "decagrams"; - @gram: prefix!(none) / prefix!(kilo); "g"; "gram"; "grams"; - @decigram: prefix!(deci) / prefix!(kilo); "dg"; "decigram"; "decigrams"; - @centigram: prefix!(centi) / prefix!(kilo); "cg"; "centigram"; "centigrams"; - @milligram: prefix!(milli) / prefix!(kilo); "mg"; "milligram"; "milligrams"; - @microgram: prefix!(micro) / prefix!(kilo); "µg"; "microgram"; "micrograms"; - @nanogram: prefix!(nano) / prefix!(kilo); "ng"; "nanogram"; "nanograms"; - @picogram: prefix!(pico) / prefix!(kilo); "pg"; "picogram"; "picograms"; - @femtogram: prefix!(femto) / prefix!(kilo); "fg"; "femtogram"; "femtograms"; - @attogram: prefix!(atto) / prefix!(kilo); "ag"; "attogram"; "attograms"; - @zeptogram: prefix!(zepto) / prefix!(kilo); "zg"; "zeptogram"; "zeptograms"; - @yoctogram: prefix!(yocto) / prefix!(kilo); "yg"; "yoctogram"; "yoctograms"; + @kilogram: prefix!(kilo) / prefix!(kilo); "kg", "kilogram", "kilograms"; + @hectogram: prefix!(hecto) / prefix!(kilo); "hg", "hectogram", "hectograms"; + @decagram: prefix!(deca) / prefix!(kilo); "dag", "decagram", "decagrams"; + @gram: prefix!(none) / prefix!(kilo); "g", "gram", "grams"; + @decigram: prefix!(deci) / prefix!(kilo); "dg", "decigram", "decigrams"; + @centigram: prefix!(centi) / prefix!(kilo); "cg", "centigram", "centigrams"; + @milligram: prefix!(milli) / prefix!(kilo); "mg", "milligram", "milligrams"; + @microgram: prefix!(micro) / prefix!(kilo); "µg", "microgram", "micrograms"; + @nanogram: prefix!(nano) / prefix!(kilo); "ng", "nanogram", "nanograms"; + @picogram: prefix!(pico) / prefix!(kilo); "pg", "picogram", "picograms"; + @femtogram: prefix!(femto) / prefix!(kilo); "fg", "femtogram", "femtograms"; + @attogram: prefix!(atto) / prefix!(kilo); "ag", "attogram", "attograms"; + @zeptogram: prefix!(zepto) / prefix!(kilo); "zg", "zeptogram", "zeptograms"; + @yoctogram: prefix!(yocto) / prefix!(kilo); "yg", "yoctogram", "yoctograms"; } } diff --git a/src/si/thermodynamic_temperature.rs b/src/si/thermodynamic_temperature.rs index ef414e90..cf9abcda 100644 --- a/src/si/thermodynamic_temperature.rs +++ b/src/si/thermodynamic_temperature.rs @@ -13,27 +13,27 @@ quantity! { Z0, // amount of substance Z0>; // luminous intensity units { - @yottakelvin: prefix!(yotta); "YK"; "yottakelvin"; "yottakelvins"; - @zettakelvin: prefix!(zetta); "ZK"; "zettakelvin"; "zettakelvins"; - @exakelvin: prefix!(exa); "EK"; "exakelvin"; "exakelvins"; - @petakelvin: prefix!(peta); "PK"; "petakelvin"; "petakelvins"; - @terakelvin: prefix!(tera); "TK"; "terakelvin"; "terakelvins"; - @megakelvin: prefix!(mega); "MK"; "megakelvin"; "megakelvins"; - @kilokelvin: prefix!(kilo); "kK"; "kilokelvin"; "kilokelvins"; - @hectokelvin: prefix!(hecto); "hK"; "hectokelvin"; "hectokelvins"; - @decakelvin: prefix!(deca); "daK"; "decakelvin"; "decakelvins"; + @yottakelvin: prefix!(yotta); "YK", "yottakelvin", "yottakelvins"; + @zettakelvin: prefix!(zetta); "ZK", "zettakelvin", "zettakelvins"; + @exakelvin: prefix!(exa); "EK", "exakelvin", "exakelvins"; + @petakelvin: prefix!(peta); "PK", "petakelvin", "petakelvins"; + @terakelvin: prefix!(tera); "TK", "terakelvin", "terakelvins"; + @megakelvin: prefix!(mega); "MK", "megakelvin", "megakelvins"; + @kilokelvin: prefix!(kilo); "kK", "kilokelvin", "kilokelvins"; + @hectokelvin: prefix!(hecto); "hK", "hectokelvin", "hectokelvins"; + @decakelvin: prefix!(deca); "daK", "decakelvin", "decakelvins"; /// The kelvin, unit of thermodynamic temperature, is the fraction of 1/273.16 of the /// thermodynamic temperature of the triple point of water. - @kelvin: prefix!(none); "K"; "kelvin"; "kelvins"; - @decikelvin: prefix!(deci); "dK"; "decikelvin"; "decikelvins"; - @centikelvin: prefix!(centi); "cK"; "centikelvin"; "centikelvins"; - @millikelvin: prefix!(milli); "mK"; "millikelvin"; "millikelvins"; - @microkelvin: prefix!(micro); "µK"; "microkelvin"; "microkelvins"; - @nanokelvin: prefix!(nano); "nK"; "nanokelvin"; "nanokelvins"; - @picokelvin: prefix!(pico); "pK"; "picokelvin"; "picokelvins"; - @femtokelvin: prefix!(femto); "fK"; "femtokelvin"; "femtokelvins"; - @attokelvin: prefix!(atto); "aK"; "attokelvin"; "attokelvins"; - @zeptokelvin: prefix!(zepto); "zK"; "zeptokelvin"; "zeptokelvins"; - @yoctokelvin: prefix!(yocto); "yK"; "yoctokelvin"; "yoctokelvins"; + @kelvin: prefix!(none); "K", "kelvin", "kelvins"; + @decikelvin: prefix!(deci); "dK", "decikelvin", "decikelvins"; + @centikelvin: prefix!(centi); "cK", "centikelvin", "centikelvins"; + @millikelvin: prefix!(milli); "mK", "millikelvin", "millikelvins"; + @microkelvin: prefix!(micro); "µK", "microkelvin", "microkelvins"; + @nanokelvin: prefix!(nano); "nK", "nanokelvin", "nanokelvins"; + @picokelvin: prefix!(pico); "pK", "picokelvin", "picokelvins"; + @femtokelvin: prefix!(femto); "fK", "femtokelvin", "femtokelvins"; + @attokelvin: prefix!(atto); "aK", "attokelvin", "attokelvins"; + @zeptokelvin: prefix!(zepto); "zK", "zeptokelvin", "zeptokelvins"; + @yoctokelvin: prefix!(yocto); "yK", "yoctokelvin", "yoctokelvins"; } } diff --git a/src/si/time.rs b/src/si/time.rs index 3d76bdba..17709f44 100644 --- a/src/si/time.rs +++ b/src/si/time.rs @@ -13,27 +13,27 @@ quantity! { Z0, // amount of substance Z0>; // luminous intensity units { - @yottasecond: prefix!(yotta); "Ys"; "yottasecond"; "yottaseconds"; - @zettasecond: prefix!(zetta); "Zs"; "zettasecond"; "zettaseconds"; - @exasecond: prefix!(exa); "Es"; "exasecond"; "exaseconds"; - @petasecond: prefix!(peta); "Ps"; "petasecond"; "petaseconds"; - @terasecond: prefix!(tera); "Ts"; "terasecond"; "teraseconds"; - @megasecond: prefix!(mega); "Ms"; "megasecond"; "megaseconds"; - @kilosecond: prefix!(kilo); "ks"; "kilosecond"; "kiloseconds"; - @hectosecond: prefix!(hecto); "hs"; "hectosecond"; "hectoseconds"; - @decasecond: prefix!(deca); "das"; "decasecond"; "decaseconds"; + @yottasecond: prefix!(yotta); "Ys", "yottasecond", "yottaseconds"; + @zettasecond: prefix!(zetta); "Zs", "zettasecond", "zettaseconds"; + @exasecond: prefix!(exa); "Es", "exasecond", "exaseconds"; + @petasecond: prefix!(peta); "Ps", "petasecond", "petaseconds"; + @terasecond: prefix!(tera); "Ts", "terasecond", "teraseconds"; + @megasecond: prefix!(mega); "Ms", "megasecond", "megaseconds"; + @kilosecond: prefix!(kilo); "ks", "kilosecond", "kiloseconds"; + @hectosecond: prefix!(hecto); "hs", "hectosecond", "hectoseconds"; + @decasecond: prefix!(deca); "das", "decasecond", "decaseconds"; /// The second is the duration of 9 192 631 770 periods of the radition corresponding to the /// transition between the two hyerfine levels of ground state of caesium 133 atom. - @second: prefix!(none); "s"; "second"; "seconds"; - @decisecond: prefix!(deci); "ds"; "decisecond"; "deciseconds"; - @centisecond: prefix!(centi); "cs"; "centisecond"; "centiseconds"; - @millisecond: prefix!(milli); "ms"; "millisecond"; "milliseconds"; - @microsecond: prefix!(micro); "µs"; "microsecond"; "microseconds"; - @nanosecond: prefix!(nano); "ns"; "nanosecond"; "nanoseconds"; - @picosecond: prefix!(pico); "ps"; "picosecond"; "picoseconds"; - @femtosecond: prefix!(femto); "fs"; "femtosecond"; "femtoseconds"; - @attosecond: prefix!(atto); "as"; "attosecond"; "attoseconds"; - @zeptosecond: prefix!(zepto); "zs"; "zeptosecond"; "zeptoseconds"; - @yoctosecond: prefix!(yocto); "ys"; "yoctosecond"; "yoctoseconds"; + @second: prefix!(none); "s", "second", "seconds"; + @decisecond: prefix!(deci); "ds", "decisecond", "deciseconds"; + @centisecond: prefix!(centi); "cs", "centisecond", "centiseconds"; + @millisecond: prefix!(milli); "ms", "millisecond", "milliseconds"; + @microsecond: prefix!(micro); "µs", "microsecond", "microseconds"; + @nanosecond: prefix!(nano); "ns", "nanosecond", "nanoseconds"; + @picosecond: prefix!(pico); "ps", "picosecond", "picoseconds"; + @femtosecond: prefix!(femto); "fs", "femtosecond", "femtoseconds"; + @attosecond: prefix!(atto); "as", "attosecond", "attoseconds"; + @zeptosecond: prefix!(zepto); "zs", "zeptosecond", "zeptoseconds"; + @yoctosecond: prefix!(yocto); "ys", "yoctosecond", "yoctoseconds"; } } diff --git a/src/si/velocity.rs b/src/si/velocity.rs index 5e5d33c6..c9935655 100644 --- a/src/si/velocity.rs +++ b/src/si/velocity.rs @@ -13,44 +13,44 @@ quantity! { Z0, // amount of substance Z0>; // luminous intensity units { - @yottameter_per_second: prefix!(yotta); "Ym/s"; "yottameter per second"; + @yottameter_per_second: prefix!(yotta); "Ym/s", "yottameter per second", "yottameters per second"; - @zettameter_per_second: prefix!(zetta); "Zm/s"; "zettameter per second"; + @zettameter_per_second: prefix!(zetta); "Zm/s", "zettameter per second", "zettameters per second"; - @exameter_per_second: prefix!(exa); "Em/s"; "exameter per second"; + @exameter_per_second: prefix!(exa); "Em/s", "exameter per second", "exameters per second"; - @petameter_per_second: prefix!(peta); "Pm/s"; "petameter per second"; + @petameter_per_second: prefix!(peta); "Pm/s", "petameter per second", "petameters per second"; - @terameter_per_second: prefix!(tera); "Tm/s"; "terameter per second"; + @terameter_per_second: prefix!(tera); "Tm/s", "terameter per second", "terameters per second"; - @megameter_per_second: prefix!(mega); "Mm/s"; "megameter per second"; + @megameter_per_second: prefix!(mega); "Mm/s", "megameter per second", "megameters per second"; - @kilometer_per_second: prefix!(kilo); "km/s"; "kilometer per second"; + @kilometer_per_second: prefix!(kilo); "km/s", "kilometer per second", "kilometers per second"; - @hectometer_per_second: prefix!(hecto); "hm/s"; "hectometer per second"; + @hectometer_per_second: prefix!(hecto); "hm/s", "hectometer per second", "hectometers per second"; - @decameter_per_second: prefix!(deca); "dam/s"; "decameter per second"; + @decameter_per_second: prefix!(deca); "dam/s", "decameter per second", "decameters per second"; - @meter_per_second: prefix!(none); "m/s"; "meter per second"; "meters per second"; - @decimeter_per_second: prefix!(deci); "dm/s"; "decimeter per second"; + @meter_per_second: prefix!(none); "m/s", "meter per second", "meters per second"; + @decimeter_per_second: prefix!(deci); "dm/s", "decimeter per second", "decimeters per second"; - @centimeter_per_second: prefix!(centi); "cm/s"; "centimeter per second"; + @centimeter_per_second: prefix!(centi); "cm/s", "centimeter per second", "centimeters per second"; - @millimeter_per_second: prefix!(milli); "mm/s"; "millimeter per second"; + @millimeter_per_second: prefix!(milli); "mm/s", "millimeter per second", "millimeters per second"; - @micrometer_per_second: prefix!(micro); "µm/s"; "micrometer per second"; + @micrometer_per_second: prefix!(micro); "µm/s", "micrometer per second", "micrometers per second"; - @nanometer_per_second: prefix!(nano); "nanom/s"; "nanometer per second"; + @nanometer_per_second: prefix!(nano); "nanom/s", "nanometer per second", "nanometers per second"; - @picometer_per_second: prefix!(pico); "pm/s"; "picometer per second"; + @picometer_per_second: prefix!(pico); "pm/s", "picometer per second", "picometers per second"; - @femtometer_per_second: prefix!(femto); "fm/s"; "femtometer per second"; + @femtometer_per_second: prefix!(femto); "fm/s", "femtometer per second", "femtometers per second"; - @attometer_per_second: prefix!(atto); "am/s"; "attometer per second"; + @attometer_per_second: prefix!(atto); "am/s", "attometer per second", "attometers per second"; - @zeptometer_per_second: prefix!(zepto); "zm/s"; "zeptometer per second"; + @zeptometer_per_second: prefix!(zepto); "zm/s", "zeptometer per second", "zeptometers per second"; - @yoctometer_per_second: prefix!(yocto); "ym/s"; "yoctometer per second"; + @yoctometer_per_second: prefix!(yocto); "ym/s", "yoctometer per second", "yoctometers per second"; } } diff --git a/src/system.rs b/src/system.rs index 83320eec..e48e335b 100644 --- a/src/system.rs +++ b/src/system.rs @@ -28,8 +28,8 @@ /// # /// Length dimension, m^(1). /// # dimension: Q; /// # units { -/// # @meter: 1.0E0; "m"; "meter"; "meters"; -/// # @foot: 3.048E-1; "ft"; "foot"; "feet"; +/// # @meter: 1.0E0; "m", "meter", "meters"; +/// # @foot: 3.048E-1; "ft", "foot", "feet"; /// # } /// # } /// # } @@ -41,7 +41,7 @@ /// # /// Mass dimension, kg^(1). /// # dimension: Q; /// # units { -/// # @kilogram: 1.0; "kg"; "kilogram"; "kilograms"; +/// # @kilogram: 1.0; "kg", "kilogram", "kilograms"; /// # } /// # } /// # } @@ -53,7 +53,7 @@ /// # /// Time dimension, s^(1). /// # dimension: Q; /// # units { -/// # @second: 1.0; "s"; "second"; "seconds"; +/// # @second: 1.0; "s", "second", "seconds"; /// # } /// # } /// # } @@ -482,8 +482,8 @@ macro_rules! system { /// # /// Length dimension, m^(1). /// # dimension: Q; /// # units { - /// # @meter: 1.0E0; "m"; "meter"; "meters"; - /// # @foot: 3.048E-1; "ft"; "foot"; "feet"; + /// # @meter: 1.0E0; "m", "meter", "meters"; + /// # @foot: 3.048E-1; "ft", "foot", "feet"; /// # } /// # } /// # } @@ -495,7 +495,7 @@ macro_rules! system { /// # /// Mass dimension, kg^(1). /// # dimension: Q; /// # units { - /// # @kilogram: 1.0; "kg"; "kilogram"; "kilograms"; + /// # @kilogram: 1.0; "kg", "kilogram", "kilograms"; /// # } /// # } /// # } @@ -507,7 +507,7 @@ macro_rules! system { /// # /// Time dimension, s^(1). /// # dimension: Q; /// # units { - /// # @second: 1.0; "s"; "second"; "seconds"; + /// # @second: 1.0; "s", "second", "seconds"; /// # } /// # } /// # } @@ -579,8 +579,8 @@ macro_rules! system { /// /// Length dimension, m^(1). /// dimension: Q; /// units { -/// @meter: 1.0E0; "m"; "meter"; "meters"; -/// @foot: 3.048E-1; "ft"; "foot"; "feet"; +/// @meter: 1.0E0; "m", "meter", "meters"; +/// @foot: 3.048E-1; "ft", "foot", "feet"; /// } /// } /// } @@ -592,7 +592,7 @@ macro_rules! system { /// # /// Mass dimension, kg^(1). /// # dimension: Q; /// # units { -/// # @kilogram: 1.0; "kg"; "kilogram"; "kilograms"; +/// # @kilogram: 1.0; "kg", "kilogram", "kilograms"; /// # } /// # } /// # } @@ -604,7 +604,7 @@ macro_rules! system { /// # /// Time dimension, s^(1). /// # dimension: Q; /// # units { -/// # @second: 1.0; "s"; "second"; "seconds"; +/// # @second: 1.0; "s", "second", "seconds"; /// # } /// # } /// # } @@ -637,7 +637,7 @@ macro_rules! quantity { $(#[$dim_attr:meta])* dimension: $system:ident<$($dimension:ident),+>; units { $($(#[$unit_attr:meta])* @$unit:ident: $conversion:expr; - $abbreviation:expr; $singular:expr; $plural:expr;)+ + $abbreviation:expr, $singular:expr, $plural:expr;)+ } ) => {