Skip to content

Commit

Permalink
Add many more imperial units
Browse files Browse the repository at this point in the history
  • Loading branch information
printfn committed Oct 21, 2023
1 parent aafc334 commit abc8ffd
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions core/src/units/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,26 +512,50 @@ const IMPERIAL_UNITS: &[UnitTuple] = &[
("'", "", "foot", ""),
("\"", "", "inch", ""),
("foot", "feet", "l@12 inch", ""),
("ft", "", "foot", ""),
("sqft", "", "=ft^2", ""),
("yard", "yards", "l@3 ft", ""),
("yd", "", "yard", ""),
("mile", "miles", "l@5280 ft", ""),
("line", "lines", "1/12 inch", ""),
("rod", "", "5.5 yard", ""),
("pole", "", "rod", ""),
("perch", "", "rod", ""),
("furlong", "", "40 rod", ""),
("statute_mile", "statute_miles", "mile", ""),
("league", "", "3 mile", ""),
("chain", "chains", "66 feet", ""),
("link", "links", "1/100 chain", ""),
("ch", "", "chain", ""),
("thou", "", "1/1000 inch", "thousandth of an inch"),
("acre", "acres", "10 chain^2", ""),
("section", "sections", "mile^2", ""),
("township", "townships", "36 sections", ""),
("homestead", "homesteads", "160 acres", ""),
("point", "points", "l@1/72 inch", ""),
("twip", "twips", "l@1/20 point", ""),
("poppyseed", "poppyseeds", "l@line", ""),
("pica", "", "l@12 points", ""),
("barleycorn", "barleycorns", "l@4 poppyseed", ""),
("finger", "fingers", "l@63 points", ""),
("stick", "sticks", "l@2 inches", ""),
("palm", "palms", "l@3 inches", ""),
("digit", "digits", "l@1/4 palms", ""),
("nail", "nails", "l@3 digits", ""),
("span", "spans", "l@4 nails", ""),
("hand", "hands", "l@2 sticks", ""),
("shaftment", "shaftments", "l@2 palm", ""),
("cubit", "cubits", "l@2 span", ""),
("ell", "", "l@5 span", ""),
("skein", "", "l@96 ell", ""),
("spindle", "", "l@120 skein", ""),
("link", "links", "l@1/25 rod", ""),
("fathom", "fathoms", "l@2 yard", ""),
("shackle", "shackles", "l@15 yard", ""),
("pace", "paces", "l@5 shaftments", ""),
("step", "steps", "l@2 paces", ""),
("grade", "", "l@pace", ""),
("rope", "", "l@4 steps", ""),
("ramsdens_chain", "", "l@5 rope", ""),
("roman_mile", "roman_miles", "l@50 ramsdens_chain", ""),
("gunters_chain", "gunters_chains", "l@4 rod", ""),
];

const LIQUID_UNITS: &[UnitTuple] = &[
Expand Down Expand Up @@ -587,6 +611,9 @@ const OTHER_WEIGHTS: &[UnitTuple] = &[
];

const IMPERIAL_ABBREVIATIONS: &[UnitTuple] = &[
("yd", "", "yard", ""),
("ch", "", "chain", ""),
("ft", "", "foot", ""),
("mph", "", "mile/hr", ""),
("mpg", "", "mile/gal", ""),
("kph", "", "km/hr", ""),
Expand Down

0 comments on commit abc8ffd

Please sign in to comment.