- Units (Unix)
Units is a
Unix computer program forconversion of units of quantities. It has a database of measurements, including esoteric and historical measurements. This for instance allows conversion of velocities specified infurlong s perfortnight , and pressures specified intons peracre . Theplain text database "units.dat" is a good reference in itself, as it is extensively commented and cites numerous sources.The original "units" program has been a standard part of Unix since the early
Bell Laboratories versions.fact|date=April 2007" [http://www.unidata.ucar.edu/downloads/udunits/index.jsp UDUNITS] " is a similar utility program, except that it has an additional programming library interface and date conversion abilities. UDUNITS is considered the "de facto" program and library for variable unit conversion for
netCDF files. [As specified from severalNetCDF conventions, e.g.:
*COARDS - cite web |title=Conventions for the standardization of NetCDF files |date=1995-02-10 |url=http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html
*CF - cite web |title=NetCDF Climate and Forecast (CF) Metadata Conventions |url=http://www.cgd.ucar.edu/cms/eaton/cf-metadata/CF-1.0.html |date=2003-10-28 ]The relatively newer
GNU free software version of "units" (or GNU Units) is written byAdrian Mariano .Usage
"Units" will output the result of the conversion in two lines. Usually the first line (multiplication) is the desired result. The second line is the same conversion expressed as a division.
"Units" can also do math while converting, including several built in mathematical functions such as sin, cos, atan, log, exp, etc.
If you attempt to convert types of measurements that are incompatible "units" will print a conformability error message and display a reduced form of each measurement.
Examples
Interactive mode
2083 units, 71 prefixes, 32 nonlinear units You have: 10 furlongs You want: miles * 1.2500025 / 0.7999984 You have: 1 gallon + 3 pints You want: quarts * 5.5 / 0.18181818 You have: sqrt(miles^2) You want: Definition: 1609.344 m You have:
On the
command line (non-interactive)% units 'ten furlongs per fortnight' 'kilometers per hour' * 0.0059871548 / 167.02424
% units cup ounces conformability error 0.00023658824 m^3 0.028349523 kg
References
External links
* [http://www.gnu.org/software/units/units.html GNU Units homepage]
* [http://gnuwin32.sourceforge.net/packages/units.htm Native port for Windows of GNU Units]
* [http://www.linuxmanpages.com/man1/units.1.php GNU Units man page]
* [http://www.unitsconvert.com On-line units converter based on Units]
* [http://www.units-converter.com A simple on-line converter based on Units]
Wikimedia Foundation. 2010.