||4 months ago|
|src||4 months ago|
|.gitignore||4 months ago|
|CC0||4 months ago|
|Cargo.lock||4 months ago|
|Cargo.toml||4 months ago|
|README.md||4 months ago|
Metrify is a tool for converting commonly-used non-metric units to metric.
Simplest way to use metrify is to invoke it with an expression in terms of non-metric units as its arguments:
metrify 1.4 short tons
The expression can contain several number + unit sequences, which are summed together if the units are compatible:
metrify 5′8″ metrify 1 acre 15 square feet
You can also invoke metrify without arguments, in which case it will give you a prompt to type the expression into. Press ^D to exit.
Metrify will pick the appropriate prefix for the given result and unit automatically. The value is rounded so that results <1 have 4 digits, <10 3 digits, <100 2 digits, <1000 1 digit and ≥1000 no digits after the decimal point. The digits before the decimal point are grouped into groups of three.
0.4929 ml 1.609 km 28.35 g 907.2 kg 28 317 cm³
Length units based on the international yard
- inch (in)
- foot (ft)
- yard (yd)
- mile (mi)
Mass units based on the international pound
- ounce (oz)
- pound (lb)
- stone (st)
- short ton
- long ton
- degrees Fahrenheit (°F)
Area units based on the international yard
- square inch (in²)
- square foot (ft²)
- square yard (yd²)
- acre (ac)
- square mile (mi²)
Volume units based on the international yard
- cubic inch (in³)
- cubic foot (ft³)
- cubic yard (yd³)
Imperial fluid volume units
- imperial fluid ounce (imp fl oz)
- imperial pint (imp pt)
- imperial quart (imp qt)
- imperial gallon (imp gal)
US customary fluid volume units
- US teaspoon (tsp)
- US tablespoon (tbsp)
- US fluid ounce (us fl oz)
- US cup (cup)
- US pint (us pt)
- US quart (us qt)
- US gallon (us gal)
Why should I use metrify instead of units(1)?
Metrify is more special-purpose than units(1), which allows it to present the user a nicer interface for the purposes it does support. For example with metrify you do not need to explicitly tell it the unit you are converting to, because due to its requirements (conversion is always from non-metric to metric) it can automatically pick the correct one.
Why should I use units(1) instead of metrify?
units(1) includes many more units than covered by metrify, in addition to allowing other conversions than non-metric to metric. It can also be used for calculations involving units, which metrify does not handle outside of addition.
Building and installation
You can build and test out metrify with
cargo run. If you want to install it
locally, you can use
cargo install --path . in the source directory.
Metrify is under Creative Commons Zero 1.0.