Skip to content

Commit

Permalink
Change syntax for unit abbreviation and description.
Browse files Browse the repository at this point in the history
  • Loading branch information
iliekturtles committed Mar 19, 2017
1 parent 3920b74 commit 8b51395
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 177 deletions.
8 changes: 4 additions & 4 deletions examples/mks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
}
Expand All @@ -47,7 +47,7 @@ mod mass {
P1, // mass
Z0>; // time
units {
@kilogram: 1.0; "kg"; "kilogram"; "kilograms";
@kilogram: 1.0; "kg", "kilogram", "kilograms";
}
}
}
Expand All @@ -63,7 +63,7 @@ mod time {
Z0, // mass
P1>; // time
units {
@second: 1.0; "s"; "second"; "seconds";
@second: 1.0; "s", "second", "seconds";
}
}
}
Expand Down
40 changes: 20 additions & 20 deletions src/si/amount_of_substance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
40 changes: 20 additions & 20 deletions src/si/electric_current.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
40 changes: 20 additions & 20 deletions src/si/length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
40 changes: 20 additions & 20 deletions src/si/luminous_intensity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
40 changes: 20 additions & 20 deletions src/si/mass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
Loading

0 comments on commit 8b51395

Please sign in to comment.